欢迎光临
我们一直在努力

反向代理配置

Plain text
复制到剪贴板
在新窗口中打开代码
EnlighterJS 3 Syntax Highlighter
server {
#下面这个部分和正常配置 https 没有什么区别
listen 443;
server_name www.hgos.top;
ssl on;
#申请域名对应的证书
ssl_certificate C:/BtSoft/nginx/conf/ssl/www.hgos.top/fullchain.pem;
ssl_certificate_key C:/BtSoft/nginx/conf/ssl/www.hgos.top/privkey.pem;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
ssl_verify_client off;
#反向代理 需要把后续.php相关的和重写index.php的部分删除
location / {
proxy_redirect off;
proxy_pass http://127.0.0.1:8081; #转发到你本地的9501端口 对应 ws 的端口
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}
server { #下面这个部分和正常配置 https 没有什么区别 listen 443; server_name www.hgos.top; ssl on; #申请域名对应的证书 ssl_certificate C:/BtSoft/nginx/conf/ssl/www.hgos.top/fullchain.pem; ssl_certificate_key C:/BtSoft/nginx/conf/ssl/www.hgos.top/privkey.pem; ssl_session_timeout 5m; ssl_session_cache shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; ssl_verify_client off; #反向代理 需要把后续.php相关的和重写index.php的部分删除 location / { proxy_redirect off; proxy_pass http://127.0.0.1:8081; #转发到你本地的9501端口 对应 ws 的端口 proxy_set_header Host $host; proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr:$remote_port; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; } }
server {
#下面这个部分和正常配置 https 没有什么区别
listen 443;
server_name www.hgos.top;

ssl on;

#申请域名对应的证书
ssl_certificate C:/BtSoft/nginx/conf/ssl/www.hgos.top/fullchain.pem;
ssl_certificate_key C:/BtSoft/nginx/conf/ssl/www.hgos.top/privkey.pem;

ssl_session_timeout 5m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
ssl_verify_client off;

#反向代理 需要把后续.php相关的和重写index.php的部分删除
location / {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:8081; #转发到你本地的9501端口 对应 ws 的端口
    proxy_set_header Host $host;
    proxy_set_header X-Real_IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
}
    }

 

赞(0) 打赏
未经允许不得转载:豪~豪的个人中心 » 反向代理配置

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

登录

注册