Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想配置 nginx 以便
http://example.net/
我明白我需要使用try_files指令,但我不明白如何实现回退机制。
try_files
多次测试后发现。如果找不到静态文件会发生什么是在try_files. 您可以将该参数设置为内部位置。在我的情况下,我使用
server { ... root /srv/example.org/web/static; index index.html; try_files $uri @redirect-to-dot-net; location @redirect-to-dot-net { rewrite ^ http://example.net redirect; } }