ubuntu 에서 nginx 반향 대 리 를 이용 하여 한 포트 아래 여러 사이트 설정
, , 。
서버 의 ip 은 다음 과 같 습 니 다. 192.168.1.101 기본 Niginx 80 포트 입 니 다.프로젝트 디 렉 터 리 는 / var / www / html 에서 다른 프로젝트 디 렉 터 리 를 새로 만 듭 니 다. / var / www / wecaht 에서 192.168.1.1 / wechat 를 방문 하면 다음 과 같이 설정 해 야 합 니 다.
8001 /etc/nginx/sites-available wechat
listen 8001;
server_name wechat.com;
root /var/www/wechat;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location ~* \.(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
ln - s / etc / nginx / sites - available / etc / nginx / sites - enable / wechat 생 성 소프트 연결 저장 서비스 nginx restart 접근 192.168.1.101: 8001 wechat 디 렉 터 리 에 접근 할 php 프로젝트 는 현재 기본 설정 파일 / etc / nginx / sites - available / default 에 역방향 프 록 시 위치 / wechat / {proxy pass 를 추가 합 니 다.http://192.168.1.101:8001; }
그리고 nginx 서버 를 다시 시작 합 니 다.
방문 하 다.http://192.168.1.101/wechat 오케이
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
용감한 바로 가기 및 우분투 응용 프로그램안녕하세요 여러분, 이 기사에서는 모든 사이트에서 pwa를 생성하고 실행기 응용 프로그램으로 추가하는 방법을 설명하고 싶습니다. 일부 웹사이트는 PWA로 설치를 허용하지 않지만 유사한 애플리케이션을 원합니다. 1. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.