nginx配置从远程获取静态资源
前置条件:现有两台内网互通机器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; }
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29