当前位置: 首页 > 工具软件 > GoTTY > 使用案例 >

nginx 做gotty (websocket) 的反向代理配置

佘茂才
2023-12-01
worker_processes  1;


events {
    worker_connections  1024;
}


http {
    include             mime.types;
    default_type        application/octet-stream; 
    sendfile            on;
    keepalive_timeout   65;


    upstream gotty_server {
        server 8.8.8.8:1234;
    }

    server {
        listen 80;
        server_name gotty.qq.com;
        location / {
            proxy_set_header Origin "";
            proxy_redirect   off;
            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;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_pass http://gotty_server;
        }
    }
}

 

 类似资料: