• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question How to forward port to flask server?

prof

New Pleskian
Server operating system version
Debian 11
Plesk version and microupdate number
18.0.65 #2
I'm currently working on a student project that requires me to deploy a super simple API. Since it's quite portable and easy to configure I've opted to use flask and since I already own a vserver that runs Plesk, I've figured I could just keep it running there as long as I need it. However when I just deployed it by running it with python on port 54447 I could not get it to work at all, even though it works on my local machine.

I pretty much just want to be able to type http://<my-ip>:54447 and interact with the API.

I tried setting up the NGINX-Proxy like here: Question - how to access python flask on my server?
I also tried setting up apache2 with additional directives like so:

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPreserveHost On

<Location "/">
ProxyPass "http://127.0.0.1:54447/"
ProxyPassReverse "http://127.0.0.1:54447/"
</Location>

Nothing seems to work, and I don't want to change configuration files by hand, since I may have already broken a previous Plesk installation that way ;-)
When I enter the domain with the port in my browser, it just seems to continue loading.

I would greatly appreciate any suggestions. I really just want to deploy the app, have it running for a few weeks and then shut it down again.
Thank you!
 
You only need to worry about doing a proxypass if you are wanting to connect to your service via standard 443 or 80 (and thus no need to add the IP:54447). If you want to go directly to port 54447 then you'll want to edit the firewall settings to open port 54447 from the outside.
 
Thanks for the quick response.

Then I have a new issue, haha. I don't know how to configure the firewall, since I don't think I ever activated it.

There's just the web application firewall setting, which doesn't let me configure any ports. Then I installed the extension "Firewall" which just lets me enable/disable some services, but seemingly doesn't let me configure ports either.
 
Sorry for the double post. An epiphany just struck me - it's a layer 8 issue.

Ionos is my vserver provider and has an external firewall configured.
This firewall of course blocks the port I'm trying to access - so I'm not even reaching my server.

I'll try the setup again and unblock the port in the firewall of Ionos. Should probably work then.
 
Back
Top