带socket.io的nginx镜像

时间:2018-05-18 15:15:49

标签: nginx socket.io mirror

我使用nginx配置了一个镜像,但是经过一段时间(大约2分钟)后,所有socket.io连接都与镜像断开连接。我试图修改超时等等,但没有任何改变。

这是我的配置文件:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    listen 443 default_server ssl;
    listen [::]:443 default_server ssl;

    server_name www.myserver.net;

    ssl_certificate /path/to/my/cert.pem;
    ssl_certificate_key /path/to/my/key.pem;

    proxy_connect_timeout 7d;
    proxy_send_timeout 7d;
    proxy_read_timeout 7d;

    client_max_body_size 50m;

    location / {
        proxy_pass http://127.0.0.1:7000;
        #proxy_pass https://127.0.0.1;
        proxy_http_version 1.1;

        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host "$server_addr:$server_port";

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        client_max_body_size 50m;
        mirror /mirror;
    }

    location /mirror {
      internal;
      resolver 8.8.8.8;
      proxy_pass https://bugfix.myserver.net$request_uri;
      proxy_set_header X-Original-URI $request_uri;
      proxy_set_header Host bugfix.apio.cloud;

      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_http_version 1.1;

      proxy_connect_timeout 7d;
      proxy_send_timeout 7d;
      proxy_read_timeout 7d;
    }
}

它有什么问题?

0 个答案:

没有答案