problem description
system: Centos 6.x
Nginx cannot be accessed after HTTPS is configured
everything was configured successfully and can be accessed normally, but later I planned to configure HTTPS for Nginx, but I couldn"t access it after following the online tutorials step by step, and the demand solution was fruitless. Pure novice learning, I hope you can give us some advice.
service iptables status -sharp
nginx -t -sharp
the configuration file is as follows:
server {
listen 80 ;
listen 445 ssl;
server_name _ localhost ***.com www.***.com ;
ssl on;
ssl_certificate /etc/nginx/ssl/***.pem;
ssl_certificate_key /etc/nginx/ssl/***.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
root /usr/share/nginx/html;
index index.html index.htm;
if ( $host != "www.***.com" ) {
rewrite "^/(.*)$" https://www.***.com/$1 permanent;
}
location / {
root /usr/share/nginx/html;
index index.html;
}
}