nginx_https_tp5_wss配置例子

server {
        listen 443;
        server_name saas.xxxx.xxx;
        ssl on;
        ssl_certificate /usr/local/nginx/cert/mwxy/saas.xxxx.xxx.pem;
        ssl_certificate_key /usr/local/nginx/cert/mwxy/saas.xxxx.xxx.key;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
        #ssl_prefer_server_ciphers on;

        index index.html index.php;
        root  /home/wwwroot/mwxy_top/public/;

        location /
        {
                if (!-e $request_filename) {
                        rewrite ^/index.php(.*)$ /index.php?s=$1 last;
                        rewrite ^(.*)$ /index.php?s=$1 last;
                        break;
                 }
        }

        location /wss
        {
                proxy_pass http://127.0.0.1:12347;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_redirect off;
        }

        include enable-php7.2.conf;

        #if (!-e $request_filename) {
        #    rewrite ^/index.php(.*)$ /index.php?s=$1 last;
        #    rewrite ^(.*)$ /index.php?s=$1 last;
        #    break;
        #}

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }
        access_log  off;
    }

猜你喜欢

转载自blog.csdn.net/wuxing164/article/details/89371180