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

Nginx 弱爆了,少个斜杠会死啊?

  •  
  •   pertersonvv · Jun 4, 2014 · 4938 views
    This topic created in 4542 days ago, the information mentioned may be changed or developed.
    以下截图,没有斜杠,死了
    http://img.itc.cn/photo/oTaXMSHTm8p
    [img=http://img.itc.cn/photo/oTaXMSHTm8p]

    加斜杠,活了
    http://img.itc.cn/photo/oTaX60FJs7V

    论坛不能插入图片?
    9 replies
    kfll
    kfll
    Jun 4, 2014❤️2
    1
    有无斜杠代表不同的路径: http://en.wikipedia.org/wiki/URI_scheme

    路径与文件系统中的目录不一定是一一对应关系;

    nginx 可使用 try_files 来尝试对应文件系统中的文件和目录: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files
    kfll
    kfll
    Jun 4, 2014
    2
    图片支持 imgur、微博和 v2ex 的图床
    sandtears
    sandtears
    Jun 4, 2014
    3
    有没有斜杠代表的含义不同,官方文档有说明的。。。

    不只是 Nginx ,很多其他的 Web 服务器对于斜杠的有无都是敏感的,比如 Python-Flask 就是
    judezhan
    judezhan
    Jun 4, 2014
    4
    秀下限帖?
    abscon
    abscon
    Jun 4, 2014
    5
    楼主大可不必如此怨念。其实很多web server都在心里默默念叨:浏览者弱爆了,多个斜杠会死啊
    yangxin0
    yangxin0
    Jun 4, 2014
    6
    多看看配置文档吧。
    xzl380
    xzl380
    Jun 4, 2014
    7
    或许你需要的是这个:server_name_in_redirect
    http://nginx.org/cn/docs/http/ngx_http_core_module.html#server_name_in_redirect
    loading
    loading
    Jun 4, 2014 via iPhone
    8
    lz 你弱爆了
    lm902
    lm902
    Jun 5, 2014
    9
    IIS8.5表示毫无压力
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1222 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:40 · PVG 07:40 · LAX 15:40 · JFK 18:40
    ♥ Do have faith in what you're doing.