Add new comment

In sites-enabled .conf I changed the listen to "listen 443 ssl;" instead of listen " listen 0.0.0.0:443;" . Now it works.
But why do I need to put these lines in my sites-enabled? Aren't they already loaded via nginx.conf?

This is my sites-enabled\example.com.conf:

server {
listen 0.0.0.0:80;
listen 443 ssl;
server_name example.com;
location / {
root /home/ericson/public_html/example.com;
index index.html index.htm;
try_files $uri $uri/ =404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
proxy_set_header X-Forwarded-Proto https;
}

Is it all correctly done?

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.