服务器A上的nginx配置
server {
listen 80;
server_name 域名;
location /uploads/profile {
root html;
index index.html;
try_files $uri @profile;
}
location @profile {
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;
proxy_pass http://B:80;
}
}
服务器B上的nginx配置
server {
listen 80;
server_name 域名;
location /uploads/profile {
root html;
index index.html;
}
}