nginx 反向代理

官方文档

参考官方文档

为了将客户端和服务器之间的连接从HTTP/1.1转换到WebSocket,使用了HTTP/1.1中可用的协议交换机制。

    location / {
        proxy_pass http://jupyterhub IP:port;
        proxy_set_header Host $host;
        proxy_set_header X-Real-Scheme $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_read_timeout 120s;
        proxy_next_upstream error;
    }

 

 

 

posted @ 2019-11-21 11:02  jiuchen  阅读(110)  评论(0编辑  收藏  举报