server {
    listen          80;
    server_name     git.daoguyujia.com;

    location / {

        # # 允许跨域
        # add_header Access-Control-Allow-Origin * always;
        # add_header Access-Control-Allow-Headers * always;
        # add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS' always;
        # add_header Access-Control-Allow-Credentials 'true' always;

        proxy_pass http://127.0.0.1:4000;
        proxy_http_version 1.1;
        proxy_connect_timeout 4s;                # 配置点1
        proxy_read_timeout 60s;                  # 配置点2，如果没效，可以考虑这个时间配置长一点
        proxy_send_timeout 12s;                  # 配置点3
        proxy_set_header Upgrade $http_upgrade;  # 支持wss
        proxy_set_header Connection "upgrade";   # 支持wss

        # proxy_set_header Host $proxy_host;
        # proxy_set_header X-Real-IP $remote_addr;
        # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    }
}

# server {
#     listen       443;
#     server_name  dev.manage.daoguyujia.com;

#     ssl on;
#     ssl_certificate      /usr/local/webserver/nginx/cert/socket.hkyuekee.com.crt;
#     ssl_certificate_key  /usr/local/webserver/nginx/cert/socket.hkyuekee.com.key;
#     ssl_session_cache    shared:SSL:1m;
#     ssl_session_timeout  5m;
#     ssl_ciphers  HIGH:!aNULL:!MD5;
#     ssl_prefer_server_ciphers  on;

#     location / {
#         proxy_pass http://127.0.0.1:3001;
#         proxy_http_version 1.1;
#         proxy_connect_timeout 4s;
#         proxy_read_timeout 60s;
#         proxy_send_timeout 12s;
#         proxy_set_header Upgrade $http_upgrade;
#         proxy_set_header Connection "upgrade";

#         proxy_set_header X-Real-IP $remote_addr;
#         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#         proxy_set_header Host $http_host;
#         proxy_set_header X-NginX-Proxy true;
#         proxy_redirect off;
#     }

# }