server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name hub.exozy.me; ssl_certificate /etc/letsencrypt/live/exozy.me/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/exozy.me/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; add_header Strict-Transport-Security "max-age=31536000" always; ssl_trusted_certificate /etc/letsencrypt/live/exozy.me/chain.pem; ssl_stapling on; ssl_stapling_verify on; location ~ ^/user/(.*)/desk/(.*)$ { return 301 /hub/desk/$2; } location /hub/desk/ { proxy_pass http://localhost:11080/guacamole/; proxy_buffering off; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_cookie_path /guacamole/ /hub/desk/; access_log off; } # Managing literal requests to the JupyterHub front end location / { proxy_pass http://localhost:8000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # websocket headers proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header X-Scheme $scheme; proxy_buffering off; } }