server {
    listen 80;
    server_name pve.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, comment out the return 301 line above and uncomment the location block below
        # include /etc/nginx/snippets/websocket.conf;
        # proxy_pass http://172.18.188.8:8006;
    }
}

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

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

    location / {
        include /etc/nginx/snippets/websocket.conf;
        # PVE runs on HTTPS with self-signed certificate
        proxy_pass https://172.18.188.8:8006;
        proxy_ssl_verify off;
    }
}
