nginx匹配所有请求路径显示index.html页面

发布时间 2024-01-04 15:05:26作者: 吃吃吃大王
server {  
    listen 80;  
    server_name example.com;  # 替换为你的域名  
  
    root /path/to/your/root;  # 替换为你的站点目录  
  
    location / {  
        try_files $uri $uri/ /index.html;  
    }  
}