By johnareid
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?
This textbox defaults to using Markdown to format your 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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
