server { listen 8080; server_name localhost; location / { proxy_pass http://192.168.9.163:8899; } location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://192.168.9.163:8888; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
标签:set,同一个,header,端口,192.168,Nginx,html,proxy,location From: https://www.cnblogs.com/shenyixin/p/17699648.html