server {
    listen 80;
    server_name openclaw.xiezhu.me;

    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.189:15888;
    }
}

server {
    listen 443 ssl;
    server_name openclaw.xiezhu.me;

    ssl_certificate /etc/letsencrypt/live/openclaw.xiezhu.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/openclaw.xiezhu.me/privkey.pem;
    
    include /etc/nginx/snippets/ssl-params.conf;

    location / {
        include /etc/nginx/snippets/websocket.conf;
        # Avoid truncated or mismatched asset responses from the upstream app.
        proxy_set_header Accept-Encoding "";
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_pass http://172.18.188.168:18789;
    }
}
