Nginx 설정 생성기
자주 쓰는 설정용 nginx.conf 스니펫을 생성합니다.
서버 설정
워크로드를 선택하고 입력이 검증된 Nginx 설정을 미리 보세요.
인증서 경로는 예시입니다. HTTPS를 활성화하기 전에 인증서를 발급받아 설치하세요. 이 도구는 인증서를 발급하지 않습니다.
다시 불러오기 전 확인: nginx -t
nginx.conf
# Generated by KitLocal — run nginx -t before reload.
server {
listen 443 ssl;
server_name example.com;
# Obtain the certificate before enabling this server.
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
gzip on;
gzip_vary on;
gzip_min_length 1000;
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri;
}
31줄907바이트nginx.conf