server {
    listen 80;
    server_name deploy.eatsun.com.cn;

    include /etc/nginx/snippets/letsencrypt.conf;

    location / {
        # Uncomment the following line to force HTTPS
        return 301 https://$host$request_uri;

        # If you want to allow HTTP access (not force HTTPS), comment out the return 301 line above
        # and uncomment the configuration below:
        # root /mnt/nfs/deploy;
        # autoindex on;
        # autoindex_exact_size off;
        # autoindex_localtime on;
    }
}

server {
    listen 443 ssl;
    server_name deploy.eatsun.com.cn;

    ssl_certificate /etc/letsencrypt/live/deploy.eatsun.com.cn/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/deploy.eatsun.com.cn/privkey.pem;
    
    include /etc/nginx/snippets/ssl-params.conf;

    root /mnt/nfs/deploy;
    autoindex on;
    autoindex_exact_size off;
    autoindex_localtime on;

    # Deny upload (standard Nginx behavior is read-only for static files)
    # Explicitly denying common upload methods just in case
    if ($request_method !~ ^(GET|HEAD)$ ) {
        return 405;
    }
}
