Deploy the Jupyter Notebook container on VPS and use Nginx as the reverse proxy

# /etc/nginx/sites-enabled/some.domain
# Change the server name {some.domain}
# Change the {host.of.notebook} and {port} in the following locations
server {
        listen 80;
        # Change the server name {some.domain}
        server_name some.domain;
        location / {
                # Change the {host.of.notebook} and {port}
                proxy_pass http://host.of.notebook:port;

                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 86400;
        }

        client_max_body_size 50M;
        error_log /var/log/nginx/error.log;

        location ~* /(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/? {
                # Change the {host.of.notebook} and {port}
                proxy_pass http://host.of.notebook:port;

                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_http_version 1.1;

                #proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Upgrade "websocket";
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 86400;
        }

}