본문 바로가기

Snippets

[Nginx] 간단한 설정 파일

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Full Strict HTTPS 모드로의 간단한 nginx 서버 설정

 



##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        charset utf-8;

        index index.html;

        server_name [도메인명];

        location ~* \.(js|html|gif|jpg|png|css|eot|ttf|woff|otf|pdf)$ {
                root [웹루트];
                expires 1d;
        }

        location / {
                return 301 https://[도메인명]$request_uri;
        }
}

server {
        listen 443;
        server_name [도메인명];

        ssl on;
        ssl_certificate         /home/example/ssl/nginx.ssl.crt2;
        ssl_certificate_key     /home/example/ssl/example.key;
        ssl_session_timeout 30m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
        ssl_prefer_server_ciphers       on;

        location ~* \.(js|html|gif|jpg|png|css|eot|ttf|woff|otf|pdf)$ {
                root [웹루트];
                expires 1d;
	}

        location / {
                proxy_pass http://localhost:8080/;
        }
}