Question

Configure Nginx for HTTPS - cannot establish secure connection!

So I got the website up and running, got HTTPS working and configured Nginx to redirect http calls over to HTTPS

sudo nano /etc/nginx/sites-enabled/default

# HTTP - redirect all requests to HTTPS:
server {
        listen 80;
        listen [::]:80 default_server ipv6only=on;
        return 301 https://$host$request_uri;
}

All seems to be working great! So goes out and have a coffee at a fast food restaurant in the city. They have wifi available so decide to check out the new website. Problem is it comes back with an error - “cannot establish an secure connection” - I am assuming their free wifi is configured not to allow HTTPS calls.

I hate to think the website may be unavailable (think of all the new users I am going to lose!). I could disable the nginx redirect to https - but my problem is the app uses needs access to the microphone and without HTTPS you get horrible request boxes.

So my question is there anyway to configure the HTTPS redirect so that if it fails to will go to normal http?

Subscribe
Share

The URL is languagevoice.com - I have not yet had chance to try the suggestion regrading ipv6only yet.

Can you share your site URL? it’s hard to say anything without more information about the error message.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

I think you need to remove the “ipv6only=on” part.