Nginx 配置

如何修改nginx拦截所有请求指向一个固定页面

server {
    listen       8080;
    server_name  localhost;
    location / {
        root  html
        index  index.html
        try_files $uri $uri/ /index.html; #try_files:如果对应目录不存在,就回去index.html
    }
}
posted @ 2023-03-30 19:53  JOKI丶  阅读(12)  评论(0)    收藏  举报