想通过 http://aaa/ceshi 访问到 http://bbb 的内容, 但是代理后一些 js ,css 文件报 404,发现是缺少前缀的问题。请问 a 机器上怎么配置? 谢谢大家
a 机器配置
location ^~/ceshi/ {
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 X-NginX-Proxy true;
proxy_pass http://192.168.0.50;
}
b 机器配置
location ^~/ceshi/ {
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 X-NginX-Proxy true;
proxy_pass http://localhost/;
}
b 机器日志
[08/Apr/2022:11:22:46 +0800] "GET / HTTP/1.0" 127.0.0.1 - -200 26867 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" "192.168.21.233, 192.168.0.53"
浏览器 Console
:81/js/chunk-f0487752.5a2a9024.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:81/js/chunk-f5dfb222.b4892263.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:81/js/chunk-f46a5f00.d5bf17fb.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:81/js/chunk-fc9277e6.a8e8a87f.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:81/js/chunk-ffb40534.0d082972.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
iview.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
gitalk.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
quill.snow.css:1