NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
wdssmq
V2EX  ›  NGINX

「//index. PHP ?s=xxx」nginx 和 apache 的重写规则中怎么匹配多余的斜线?

  •  
  •   wdssmq ·
    wdssmq · Jul 17, 2021 · 2318 views
    This topic created in 1808 days ago, the information mentioned may be changed or developed.

    https://www.v2ex.com//index.php?s=xxxx 想以双斜线为特征屏蔽掉这样的访问。

    还有之前的一个问题:

    帮写一条 .htaccess 规则( 301 ) - V2EX:

    https://www.v2ex.com/t/787838#reply0

    感觉完全不知道该怎么提炼标题- -

    2 replies    2021-07-17 11:23:06 +08:00
    ik
        1
    ik  
       Jul 17, 2021 via iPhone
    昨天也遇到这样的问题, nginx location 匹配的时候多斜线已经成了单斜线了。 没有详细研究是否能关闭这个合并功能,最后一段一段匹配出来再自己拼接解决的。
    ik
        2
    ik  
       Jul 17, 2021 via iPhone
    搜了一下 merge_slashes off; 这个配置可能能关闭合并功能

    https://blog.csdn.net/lyl117363/article/details/100655136
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:13 · PVG 03:13 · LAX 12:13 · JFK 15:13
    ♥ Do have faith in what you're doing.