请教 nginx 的 rewrite 配置问题
資深大佬 : plko345 6
我希望 ex.com/abc 能自动在末尾加上 ex.com/abc/, /abc/ 有斜杠的会代理到后端
我用的是 openresty, 理论上和 nginx 没什么差别
# 一 location / { ... proxy_pass ex2.com; } # 二 location /abc { rewrite ^/(abc)$ $1/ permanent; } # 三 location /abc/ { ... proxy_pass ex2.com; }
现在问题是, 一个 nginx 成功, 另一个 nginx 失败, 配置除了域名都是一样的, 搞了一晚上了
有大佬有遇到过吗? 或者给个解题思路, 或者有没有其它方案, 先放过了
大佬有話說 (1)