Fixed: Nginx WebSocket configuration causing Single User Servers to miss out api requests
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# nginx/conf.d/jupyterhub.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name _; # Respond to all hostnames
|
||||
@@ -14,8 +13,12 @@ server {
|
||||
# WebSocket support (crucial for Jupyter)
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
proxy_send_timeout 86400;
|
||||
|
||||
# Disable buffering for WebSocket
|
||||
proxy_buffering off;
|
||||
|
||||
# Handle large file uploads
|
||||
client_max_body_size 100M;
|
||||
|
@@ -11,6 +11,13 @@ http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# WebSocket connection mapping
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
|
||||
# Log format
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
|
Reference in New Issue
Block a user