zoukankan      html  css  js  c++  java
  • nginx配置wss

    upstream websocket {
    server 127.0.0.1:9501;#wss配置代理到ws:127.0.0.1:9501
    }
    server {
    listen 80;
    listen 443 ssl;
    server_name api.meigou.local.com;
    
    ####ssl须使用openssl生成 ssl_certificate
    /Users/apple/ssl/aliyun_server.pem; ssl_certificate /Users/apple/ssl/server.crt; ssl_certificate_key /Users/apple/ssl/aliyun_server.key; ssl_certificate_key /Users/apple/ssl/server.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;
    #######openssl生成
    #rewrite ^(.*)$ https://$host$1 permanent; #charset koi8-r; if ($time_iso8601 ~ "^(d{4})-(d{2})-(d{2})") { set $year $1; set $month $2; set $day $3; } access_log logs/api.meigou.local.com.access-$year-$month-$day.log.log main; index index.html index.htm index.php;
    ##访问域名wss://api.meigou.local.com/wss 即可 location
    /wss {   proxy_pass http://websocket;##代理到上面的ip   proxy_http_version 1.1;   proxy_set_header Upgrade $http_upgrade;   proxy_set_header Connection "Upgrade"; } location / { root /Users/apple/Documents/workspace/meigou_api/public; # index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string; client_max_body_size 50m; limit_req zone=one burst=5 nodelay; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ .php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root /Users/apple/Documents/workspace/meigou_api/public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; client_max_body_size 50M; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /.ht { # deny all; #} }
  • 相关阅读:
    Maximum sum-动态规划
    Ubuntu14下Hadoop开发<1> 基础环境安装
    POJ 3252 Round Numbers 数学题解
    ubuntu环境 rake aborted!
    oracle decode函数用法
    Android多线程研究(1)——线程基础及源码剖析
    2014冬去春来
    Android中的动画详解系列【4】——Activity之间切换动画
    JavaScript你所不知道的困惑(3)
    研发人员技术定级的一些思考
  • 原文地址:https://www.cnblogs.com/guokefa/p/11776493.html
Copyright © 2011-2022 走看看