#user root; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream qinysoft{ server 127.0.0.1:9090; } server { listen 9091; server_name localhost; location / { proxy_intercept_errors on; index index.html index.htm; try_files $uri $uri/ /index.html; } location /stage-api/{ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://qinysoft/; } location /dev-api/{ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #禁用缓存 proxy_buffering off; proxy_pass http://qinysoft/; } location /prod-api/{ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://qinysoft/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }