Nginx 配置反向代理不生效
Nginx 配置
server {
listen 8084;
server_name 192.168.1.73 localhost;
server_name_in_redirect off;
#charset koi8-r;
#access_log logs/host.access.log main;
rewrite ^(.*)(?i)jsessionid(.*)$ / redirect;
location / {
root E:/nginx-1.18.0/zrzyj;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location ~/erms {
#Proxy Settings
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods *;
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500
http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_pass http://192.168.1.73:8815;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}