동일한 인스턴스 (예 : 포트 80 및 포트 81)의 두 포트에서 nginx를 구성하려고합니다. 그러나 지금까지 행운은 없습니다. 여기에 내가 뭘하려고 오전의 예입니다Nginx를 여러 포트에서 실행하는 방법
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name chat.local.com;
location/{
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_buffering off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 81;
server_name console.local.com;
location/{
proxy_pass http://127.0.0.1:8888;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_buffering off;
}
}
}
내가 console.local.com를 실행하려고, 그것은 chat.local.com의 내용을 보여줍니다. 두 개의 포트에서 nginx를 실행할 수있는 방법이 있습니까? 미리 감사드립니다!
안녕 Cobaco, 나는 완전히 내가 그 점을 지적하기위한 포트 (81) 감사 페이지에 액세스해야하는 위치를 잊어 버렸의 nginx와 함께 작동합니다. – Uday