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

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

    location / {
        return 301 https://$host$request_uri;
    }
}

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

    ssl_certificate /etc/letsencrypt/live/pgsql.xiezhu.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/pgsql.xiezhu.me/privkey.pem;

    include /etc/nginx/snippets/ssl-params.conf;

    location / {
        include /etc/nginx/snippets/websocket.conf;
        proxy_pass http://172.18.188.198:8081;
    }
}
