server {
    listen 8333;
    server_name localhost;
    
    root /usr/share/nginx/html;
    index index.html;
    
    location / {
        try_files $uri $uri/ /index.html;
        add_header Cache-Control "no-store, no-cache, must-revalidate"; # 禁用缓存
    }

    location /cffp/ {
        alias /usr/share/nginx/html/;
        try_files $uri $uri/ /cffp/index.html;
    }

    # 禁止访问 .env 文件
    location ~ /\.env {
        deny all;
        return 404;
    }

    # 错误处理
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    # 访问日志
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
}
