Question
NGINX SSL Connection Refused..
I followed this guide exactly how it says:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-with-http-2-support-on-ubuntu-16-04
However the protocol is still HTTP 1, doesn’t redirect to HTTPS and when visiting https://sub.domain.com/ I get connection refused.
Website is vote.essaeg.ca, it’s a subdomain, the SSL certificate I got from namecheap allows for subdomains.
I tried making the server name both the domain and with the subdomain, no change. I tried this command and it gave an nginx error 111.
Here is my configuration file:
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl on;
ssl_certificate /etc/nginx/ssl/essaeg_ca.crt;
ssl_certificate_key /etc/nginx/ssl/vote.essaeg.ca.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
root /var/www/html;
server_name essaeg.ca;
return 301 https://$server_name$request_uri;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80;
listen [::]:80;
server_name essaeg.ca;
return 301 https://$server_name$request_uri;
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×