Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python run flask on https with port 80

I’m trying to run my flask app on localhost with https and port 80. It works, but turns out I need to specify the port in the browser url when navigating to the app.
So, if I go to https://localhost on my browser, the app doesn’t show, but if I go to https://localhost:80 the page works.
Is there a way to reach the app without specifying the port when typing the url? Shoudln’t it be 80 by default when I don’t specify the port?
Thanks in advance!

I’m expecting to reach the website without needing to specify the port when it is 80.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The problem is that you are running your app on port 80(default port for http) with https configured.

When accessing https://localhost the browser tries to access the port 443 (the default port for https), while your app is hosted on port 80.

Changing the hosting port to 443 should allow you to access https://localhost without specifying the port.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading