[[nginx]]

*説明 [#f89ba928]
nginxをリバースプロキシを運用しつつ、SSLアクセラレータとして運用する手順です。

*内容 [#p31ad905]
 # cd /etc/nginx
 # mkdir ssl
 # vi hogehoge.crt
 --
 SSL証明書と中間証明書を一緒にしたファイルを作成する。
 ---
 # vi hogehoge.key
 ---
 CSRを作成した際に使用した秘密鍵ファイルを作成する。
 ---
 # cd ../conf.d
 # vi ssl.conf
 ---
 # HTTPS server
 #
 server {
    listen       443 default ssl;
    server_name  hogehoge.com;
 
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
 
    ssl                  on;
    ssl_certificate      /etc/nginx/ssl/hogehoge.crt;
    ssl_certificate_key  /etc/nginx/ssl/hogehoge.key;
 
 #    ssl_session_timeout  5m;
 #    ssl_protocols  SSLv2 SSLv3 TLSv1;
 #    ssl_ciphers  HIGH:!aNULL:!MD5;
 #    ssl_prefer_server_ciphers   on;
 
    location / {
         proxy_pass http://backend;
    }
 
    location = /favicon.ico {
         access_log off;         log_not_found off;
    }
 
 }

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS