使用 nginx 作为反向代理,我想index用proxy_pass. 因此我希望 nginx 查询/index.html而不是/,/sub/index.html而不是/sub/.
做到这一点的最佳方法是什么?
不确定它是否相关,但代理服务器确实HTTP 200在 上应答/,但我仍然想将其重写为/index.html.
由于/请求通过列出目录内容泄漏了一些信息,我还想确保没有人能够访问它(就像做类似的事情/sub/..)。
谢谢
只需添加:
rewrite (.*)/$ $1/index.html last;
rewrite (.*)/..$ $1/../index.html last;
Run Code Online (Sandbox Code Playgroud)
应该有效
| 归档时间: |
|
| 查看次数: |
549 次 |
| 最近记录: |