The Hottest Porn Videos Online mecum.porn Quality porns videos Free indian porn tube videos indiansexmovies.mobi hot indian women watch online
【转】Nginx实现端口转发

查看原文:Nginx 实现端口转发——星河赵博客

Summary

Nginx在监听某一端口(如80端口)时,通过配置负载均衡池,根据不同的域名,将同一端口的HTTP/HTTPS请求分发到不同的端口。

实例如下:

##负载均衡池
upstream one_pool{
    server 127.0.0.1:5000;
}
upstream two_pool{
    server 127.0.0.1:6000;
}

##server one
server {
    #listenning on 80
    listen 80;
    server_name one.poryoung.cn;
    #redirect to https
    return 301 https://$server_name$request_uri;
}
server {
    listen 443;
    server_name one.poryoung.cn;
    location / {
        proxy_pass http://one_pool;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    #Allow HTTPS
    ssl on;
    # Let's Encrypt生成的SSL证书:
    ssl_certificate /.../*.poryoung.cn/fullchain.cer;
    ssl_certificate_key /.../*.poryoung.cn.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
}
##server two
server {
    #listenning on 80
    listen 80;
    server_name two.poryoung.cn;
    #redirect to https
    return 301 https://$server_name$request_uri;
}
server {
    listen 443;
    server_name two.poryoung.cn;
    location / {
        proxy_pass http://two_pool;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    #Allow HTTPS
    ssl on;
    # Let's Encrypt生成的SSL证书:
    ssl_certificate /.../*.poryoung.cn/fullchain.cer;
    ssl_certificate_key /.../*.poryoung.cn.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
}

其中的域名和证书部分需要替换。

Let’s Encrypt已经支持泛域名证书申请,网上有许多教程,比较详细的如Let’s Encrypt免费泛域名证书申请教程步骤,使用ACME.sh申请。

在申请过程中,./acme.sh --issue -d *.xxorg.com -d xxorg.com --dns./acme.sh --renew -d *.xxorg.com -d xxorg.com命令可能会遇到dns manual mode警告而失败的情况,在其后加上--yes-I-know-dns-manual-mode-enough-go-ahead-please即可

本文链接:【转】Nginx实现端口转发

转载声明:本站文章若无特别说明,皆为原创,转载请注明来源:PorYoung,谢谢!^^

No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next