NGINX에서 가상 호스트(Virtual Host)에 HTTP/2를 설정하는 방법
NGINX 버전 확인
nginx -v
1. http2 on; 방식
이 지시문은 버전 1.25.1에 나타났습니다.
#default.conf configure
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
#Settings for a TLS enabled server.
server {
listen 443 ssl;
http2 on;
server_name _;
root /usr/share/nginx/html;
index index.html index.htm;
...
}
2. listen 443 ssl http2; 방식
#default.conf configure
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
#Settings for a TLS enabled server.
server {
listen 443 ssl http2;
server_name _;
root /usr/share/nginx/html;
index index.html index.htm;
...
}
3. HTTP/2 테스트
curl 명령어
curl -I --http2 -k https://example.com
온라인 HTTP/2 테스트 도구

참고URL
- Nginx Documentation : http2 directive
'리눅스' 카테고리의 다른 글
| [draft] stormssh 설치 후 collections 모듈 에러 (0) | 2025.10.29 |
|---|---|
| [draft] mac(macOS)에 stormssh 설치 및 설정하기 (0) | 2025.10.29 |
| [draft] 커널 컴파일 및 설치하는 방법 (0) | 2025.10.29 |
| [draft] rpcgen install for centos 8 (0) | 2025.10.26 |
| [draft] 파일 시스템의 기본 블록 크기를 확인하는 방법 (0) | 2025.10.26 |