標籤:

nginx 子域名多埠配置

server { listen 80;server_name your-url.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:{PORT1}; }}server { listen 80;server_name colores.your-url.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:{PORT2}; }}server { listen 80;server_name blog.your-url.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:{PORT3}; }}

(note that the {PORT NUMBERS} should be replaced by the ports your applications are listening to.


推薦閱讀:

Kong - The Microservice API Gateway
nginx快速入門之基本原理篇
如何 windows下nginx+django+flup python3?
給小白的 Nginx 30分鐘入門指南
Rails、Nginx、Passenger、bundle,這幾者是怎麼協作的?

TAG:Nginx |