具体需求如图 怎么将 URL 中的aaabcd更改为aaabbd

具体需求如图 怎么将 URL 中的aaabcd更改为aaabbd

|
daimaosixJan 10, 2022
1
location /aaabcd {
proxy_pass 源站 /aaabbd; } 这样不行吗? |
|
sparktourJan 10, 2022
3
nginx 的 sub_filter 可以做到替换源站的字符串,参考 https://www.nginx.com/resources/wiki/modules/substitutions/
|
|
cattyhouseJan 11, 2022 via iPhone
4
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; } |
|
swcatJan 11, 2022
5
openresty 解千愁
|
|
xiwangzishiJan 11, 2022
6
OpenResty: 这题我会
|
|
7
@cattyhouse 谢谢老哥 问题解决了
|
|
darknollJan 11, 2022
8
同问下,caddy 里面怎么做
|