Home > Blockchain >  Python run flask on https with port 80
Python run flask on https with port 80

Time:03-25

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.

CodePudding user response:

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.

  • Related