标签:direct image lin com code ken word rem keyword
前置条件:现有两台内网互通机器192.168.0.100、192.168.0.101,其中192.168.0.100可以通过外网网络。
业务需求:需要通过外网访问处于192.168.0.101机器上的静态资源。
192.168.0.100nginx配置:
location /upload {
alias /data/image/upload;
try_files $uri @new_server;
}
location @new_server {
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://192.168.0.101:80;
}
192.168.0.101nginx配置:
location /upload {
alias /data/image/upload;
}
标签:direct image lin com code ken word rem keyword
原文地址:https://www.cnblogs.com/danger0us/p/12326116.html