原文地址:https://nestealin.com/6a8506af/
location @handle_redirect { resolver 223.5.5.5; set $saved_redirect_location '$upstream_http_location'; # include firewall.conf;
# 启用 sub_filter sub_filter 'link href=src/assets/' 'link href=/src/assets/'; sub_filter 'script src=src/assets/' 'script src=/src/assets/'; # 替换多次 sub_filter_once off;
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_set_header X-Real-Port $remote_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass $saved_redirect_location; }
location / { # include firewall.conf;
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_set_header X-Real-Port $remote_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass https://xxxx.net; proxy_intercept_errors on; recursive_error_pages on; error_page 301 302 307 = @handle_redirect; }
简单的网页还行,现在网页一堆js,css,路径乱七八糟 处理起来实在麻烦啊,怎么办?
|