Ngnix反向代理相关(静态资源访问源站)

Administrator 315 2022-07-19

对于流量比较少的VPS,设置静态资源访问源站

rewrite ^/(.*)\.jpg$ http://fx.abc.com:88/$1.jpg permanent;
rewrite ^/(.*)\.gif$ http://fx.abc.com:88/$1.gif permanent;
rewrite ^/(.*)\.png$ http://fx.abc.com:88/$1.png permanent;
rewrite ^/(.*)\.js$ http://fx.abc.com:88/$1.js permanent;
rewrite ^/(.*)\.css$ http://fx.abc.com:88/$1.css permanent;
rewrite ^/(.*)\.flv$ http://fx.abc.com:88/$1.flv permanent;
rewrite ^/(.*)\.doc$ http://fx.abc.com:88/$1.doc permanent;
rewrite ^/(.*)\.zip$ http://fx.abc.com:88/$1.zip permanent;
rewrite ^/(.*)\.rar$ http://fx.abc.com:88/$1.rar permanent;
rewrite ^/(.*)\.exe$ http://fx.abc.com:88/$1.exe permanent;