티스토리 뷰

Snippets

[Nginx] 간단한 설정 파일

Snipper AquaBlue 2017. 9. 26. 10:32

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/;
        }
}



댓글
댓글쓰기 폼
공지사항
최근에 달린 댓글
Total
125,395
Today
21
Yesterday
13
링크
«   2021/04   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
글 보관함