Nginx从任何子文件夹重定向到root index.html

Nginx从任何子文件夹重定向到root index.html,nginx,nginx-location,nginx-reverse-proxy,Nginx,Nginx Location,Nginx Reverse Proxy,任何作为子文件夹放置的内容,都将读取domain.com/index.html 与此类似,但在Nginx中 server { listen 80; listen [::]:80; server_name example.com; root /apt/website/path; index index.html; location / { try_files $uri $uri/ /index.html; } }

任何作为子文件夹放置的内容,都将读取domain.com/index.html

与此类似,但在Nginx中

server {

    listen 80;
    listen [::]:80;

    server_name example.com;
    root /apt/website/path;
    index index.html;

    location / {
    try_files $uri $uri/ /index.html;
    }
}