Nginx on port 443 won't serve page
Question: I am telling nginx to listen on port 443 and it doesn't work even though my config test is passing. What's wrong?
server {
listen 443;
server_name localhost;
server_tokens off;
# These are the same certs vfcp has been using.
ssl_certificate /etc/pki/tls/certs/localhost.crt;
ssl_certificate_key /etc/pki/tls/private/localhost.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.0;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_prefer_server_ciphers on;
(...)
}
Answer:
You are missing the "ssl on;" directive. You can either specify it with
A) Adding ssl after 443:
server {
listen 443 ssl;
or
B) add a new line insider server {} with ssl on;
server {
listen 443;
ssl on;
Note that only solution (B) is compatible with npm module nginx-conf 1.X (I didnt try 2.X).
Recent Comments