How to set up http/2(h2) on nginx (and spdy…)

참조 URL : http://nginx.org/en/docs/http/ngx_http_v2_module.html

먼저… spdy 설정은 하지 않는다…
그냥 h2 지원만 해주면 된다는 것…!

openssl, nginx 등은 설치 되어 있다고 가정 한다.

 

nginx 환경 확인


# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx
...omit...
--with-http_v2_module

http_v2_module 을 지원하는지 (결과에 문자열이 보이는 지) 확인 하자

 

nginx 설정


server {
listen 443 ssl http2;

ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
}

중요한 부분은 “listen” 지시자의 마지막에 “http2” 가 추가 되는 것…
그 이외의 부분은 SSL 적용에 대한 내용 이다.

 

지원 여부 확인 (by chrome)

크롬브라우저의 개발자모드(F12) -> Network 탭 -> 출력되는 항목의 제목 필드를 마우스 우클릭 후 (protocol 항목 추가 선택)

이후 브라우저를 리프레시 하여 “protocol” 필드에 “h2″가 출력되면 완료 된 것.

 

 

 

About KENNETH 19688 Articles
지락문화예술공작단

Be the first to comment

Leave a Reply

Your email address will not be published.


*


이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.