https://www.aifou.net/2019/10/23/nginx-proxy-pass/
静态文件丢失需要单独给设置
location /wxpaydemoh5
{
proxy_pass http://172.16.90.25:8080;
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_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
add_header Cache-Control no-cache;
expires 12h;
}
location ~ /static/.*\.(js|css|jpg|png|gif|ico)$ {
proxy_pass http://172.16.90.25:8080;
rewrite ^/wxpaydemoh5/static/(.*)$ /static/$1 last;
}
转载请注明:有爱前端 » nginx静态文件(css,js等)反向代理