具体需求如图 怎么将 URL 中的aaabcd更改为aaabbd
1
daimaosix 2022-01-10 21:09:20 +08:00
location /aaabcd {
proxy_pass 源站 /aaabbd; } 这样不行吗? |
3
sparktour 2022-01-10 22:05:46 +08:00
nginx 的 sub_filter 可以做到替换源站的字符串,参考 https://www.nginx.com/resources/wiki/modules/substitutions/
|
4
cattyhouse 2022-01-11 05:42:05 +08:00 via iPhone
location / {
# 网站镜像 # 此时 root /var/www/html; 的内容不会再显示 # limit_req zone=mylimit; # 启用限制 # 先定义好要 mirror 的网站以及自己的网站 set $upstream_server http://mirror_domain.tld; set $upstream_domain mirror_domain.tld; set $mydomain example.com; # use variable to avoid resoling failure that leads to start nginx failure # refer: https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/ sub_filter_once off; sub_filter_types *; sub_filter $upstream_domain $mydomain; proxy_set_header Referer $upstream_server; proxy_set_header Host $upstream_domain; proxy_pass $upstream_server; } |
5
swcat 2022-01-11 09:38:44 +08:00
openresty 解千愁
|
6
xiwangzishi 2022-01-11 10:01:32 +08:00
OpenResty: 这题我会
|
7
LIBQ OP @cattyhouse 谢谢老哥 问题解决了
|
8
darknoll 2022-01-11 11:29:30 +08:00
同问下,caddy 里面怎么做
|