【问题标题】:Want hide directory nginx but didnt lost the content想要隐藏目录 nginx 但没有丢失内容
【发布时间】:2013-01-01 19:27:28
【问题描述】:

我的应用程序中有文件夹图像、css、类、js,包括。 如果有人访问该文件夹 --> 403 Forbidden

我想自定义这个输出403 Forbidden ---> 404 Not Found

我会试试这个代码

location ~ /(.*)/{ return 404; }

成功了,输出404 Not Found 但是我的图像、css、类、js 在我的应用程序中包含 LOST。

请帮帮我。

【问题讨论】:

    标签: nginx hide http-status-code-404 http-status-code-403


    【解决方案1】:
    location  = /THAT_FOLDER/ { return 404; }
    
    Directives with the "=" prefix that match the query exactly (literal string). 
    If found, searching stops.
    

    参考:http://wiki.nginx.org/HttpCoreModule#location

    【讨论】:

      猜你喜欢
      • 2012-09-11
      • 1970-01-01
      • 1970-01-01
      • 2019-05-11
      • 2014-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多