vim /data/application/nginx-1.10.3/conf/nginx.conf
sendfile on;
#tcp_nopush on;
#keepalive_timeout 65;
keepalive_timeout 0;
#gzip on;
# server {
# listen 80;
# server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# location / {
# root html;
# index index.html index.htm;
# }
#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;
# }
# }
server {
listen 80;
server_name aaaa.com localhost;
location / {
root /aaa-sys; # 站点根目录
try_files $uri $uri/ /index.html;
}
location ^~ /aaa_system {
#proxy_pass http://custom-file-servier.app.aa.com/customFileServier/;
proxy_pass http://training-system.app.aaa.com/training_system/;
#proxy_set_header Host 127.0.0.1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~ /customFileServier {
proxy_pass http://custom-file-servier.app.aaa.com/customFileServier/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 20m;
}
}
}
标签:set,http,header,URL,nginx,html,proxy,转发,location From: https://blog.51cto.com/u_14650780/5998728