1. 적용 예제
1-1.
server {
listen 443;
server_name 도메인주소
ssl on;
ssl_certificate /xxx/xxx/cert.pem;
ssl_certificate_key /xxx/xxx/cert.key;
location / {
root path
}
}
1-2.
server {
listen 포트번호 ssl;
server_name localhost;
ssl on;
ssl_certificate /xxx/xxx/cert.pem;
ssl_certificate_key /xxx/xxx/cert.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;
index index.html test.jsp;
}
}
1-3.
server {
listen 443;
ssl on;
ssl_certificate /xxx/xxxl/your_domain_name.pem; (or bundle.crt)
ssl_certificate_key /xxx/xxx//your_domain_name.key;
server_name your.domain.com;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {
root /home/www/public_html/your.domain.com/public/;
index index.html;
}
}
2. 관련 설정
2-1. ssl_session_cache
Syntax: ssl_session_cache off | none | [builtin[:size]] [shared:name:size]; Default: ssl_session_cache none; Context: http, server
- builtin 방식보다 shared 방식이 효율이 더 좋다.
- builtin 방식과 shared 방식을 혼용하여 사용할 수도 있다. 그러나 shared 방식을 단독으로 사용하는 것이 더 효율이 좋다.
- SSL Session Cache 벤치마크 결과 : https://www.peterbe.com/plog/ssl_session_cache-ab
2-2. ssl_session_timeout
Syntax: ssl_session_timeout time; Default: ssl_session_timeout 5m; Context: http, server
