茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1674034 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
HoneyMoon_Day2_00065.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2018/12/21 10:47:22
Nginx 加上 SSL 設定 (reverse proxy mode)

如果已經用 nginx 架好 reverse proxy (架設方式: http://snippetinfo.net/media/671/)
然後要加上 SSL 的話,比較簡單的方法是設定好之後,放在 /etc/nginx/conf.d 下面
這樣一來,一個站一個 SSL,就可以很清楚不會混淆了!

設定方式如下:
先在 /etc/nginx/conf/nginx.conf 加上
upstream ssl_backend {
        server w.x.y.z:4443;
}

ssl_session_cache   shared:SSL:10m;
ssl_session_timeout 10m;

然後在 /etc/nginx/conf.d/ 下面丟一個你自己網域的 conf 檔,設定好後重啟 nginx 即可! (e.g: snippetinfo.net.conf)
server {
    listen              443 ssl;

    # if you wanna to enable HTTP/2 (need nginx 1.9.5+)
    #listen              443 ssl http2;
    #listen              [::]:443 ssl http2;


    server_name         *.snippetinfo.net;
    ssl_certificate     /etc/httpd/conf/ssl/snippetinfo.net.crt;
    ssl_certificate_key /etc/httpd/conf/ssl/snippetinfo.net.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;
    location / {
        add_header X-Proxy-Cache    $upstream_cache_status;
        proxy_pass                  https://ssl_backend;
        proxy_set_header            Host $host;
        proxy_set_header            X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_cache_key             "$scheme$host$request_uri";
        proxy_cache                 STATIC;
        proxy_cache_valid           200  7d;
        proxy_cache_bypass  $http_cache_control;
        proxy_cache_use_stale       error timeout invalid_header updating
                                    http_500 http_502 http_503 http_504;

    }

}


原文出處:Nginx 加上 SSL 設定 (reverse proxy mode) | 老洪的 IT 學習系統
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|