Nginx 가상 호스트 설정 과 다 중 도 메 인 이름, 다 중 포트, 다 중 가상 컴퓨터 설정
1211 단어 Linux 시스템
가상 호스트 의 설정 위치: / etc / nginx / conf. d / 디 렉 터 리 의 default. conf 중
[xiaokang@localhost conf.d]$ cat default.conf
루트 가 nginx 루트 디 렉 터 리 인 것 을 볼 수 있 습 니 다.
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
[xiaokang@localhost conf.d]$ ll /usr/share/nginx/html
total 8
-rw-r--r--. 1 root root 494 Apr 23 22:36 50x.html
-rw-r--r--. 1 root root 612 Apr 23 22:36 index.html
[xiaokang@localhost conf.d]$ sudo vim /usr/share/nginx/html/index.html
2. xiaokang 가상 호스트 를 추가 합 니 다. 여러 가상 호스트 를 추가 하면 여러 개의. conf 파일 을 만 듭 니 다.
[xiaokang@localhost conf.d]$ sudo cp default.conf xiaokang.conf
[xiaokang@localhost conf.d]$ ls
default.conf xiaokang.conf
xiaokang. conf 내용 편집 은 다음 과 같 습 니 다.
server {
listen 80;
server_name www.xiaokang.test;
root /data/www;
index index.html index.htm;
}
3. 다 중 도 메 인 이름, 다 중 포트
가상 호스트 가 여러 포트 와 도 메 인 이름 을 설정 합 니 다.
server {
listen 80;
listen 9999;
server_name www.xiaokang.test www.xiaokang3.test;
root /data/www;
index index.html index.htm;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Shell 스 크 립 트 의 다 중 작업 을 동시에 수행 합 니 다.순환 체 의 "echo $i"명령 은 직렬 로 실 행 된 것 을 볼 수 있 습 니 다.그러나 실행 하 는 명령 이 오래 걸 리 면 전체 프로그램의 실행 시간 이 매우 길 고 심지어 프로그램 이 실 행 될 때 거기에 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.