CentOS 8.0 nginx ssl 접근

설치[root@localhost ~]# dnf install nginx -y
nginx 홈 디 렉 터 리 로 전환[root@localhost ~]# cd /etc/nginx/
ssl 키 생 성[root@localhost ~]# openssl req -new -newkey rsa:4096 -nodes -keyout server.key -out server.csr
자체 서명 인증서 생산[root@localhost ~]# openssl req -newkey rsa:4096 -nodes -keyout server.key -x509 -days 365 -out server.crt
백업 nginx. conf[root@localhost ~]# cp -p nginx.conf nginx.conf.bak
nginx. conf 설정[root@localhost ~]# vim nginx.conf
     # 
server {
        listen       443 ssl http2 default_server;
        listen       [::]:443 ssl http2 default_server;
        server_name  www.jnds.com; (  )
        root         /usr/share/nginx/html; (      )

        ssl_certificate "/etc/nginx/server.crt"; (      )
        ssl_certificate_key "/etc/nginx/server.key"; (      )
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers PROFILE=SYSTEM;
        ssl_prefer_server_ciphers on;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

서비스 다시 시작[root@localhost ~]# systemctl restart nginx
방화벽 을 닫다[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# setenforce 0

좋은 웹페이지 즐겨찾기