• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Port Forwarding

Sysop

Basic Pleskian
How can I forward certain IP traffic coming from port 80 to another port on my server (eg. Port 7272)?

Screen Shot 2021-04-30 at 12.34.48 PM.png
I tried to do this from within Plesk Firewall but I get an error stating "Invalid IP address or network." (eg. Destination IP = 25.25.25.25:7272).
 
You could try and use something like:

Additional nginx directives

Code:
location = / {
return 301 https://domain.tld:7272;
}

I hope it helps.
 
Better to use proxy_pass for a transparent redirect.
Also, this will probably conflict with redirect to https if that is active in nginx. Port redirecting by firewall would still work because it catches the packets before nginx.
 
Better to use proxy_pass for a transparent redirect.
Also, this will probably conflict with redirect to https if that is active in nginx. Port redirecting by firewall would still work because it catches the packets before nginx.
I was wanting to use the firewall although when i installed firewalld it conflicted with the Plesk firewall, so I’m not quite sure how to handle that.

Do you have an example of the nginx directive to use proxy pass in the way you describe?

Thanks!
 
I was wanting to use the firewall although when i installed firewalld it conflicted with the Plesk firewall, so I’m not quite sure how to handle that.

Do you have an example of the nginx directive to use proxy pass in the way you describe?

Thanks!
Note: there's been three different solutions mentioned.

a) a redirect - this will receive an HTTP request, and respond with a location header asking the browser to access the new URL. Likely not what you want.
b) a HTTP proxy - this was receive the HTTP request, and send that same request to the server you're proxying to, then return that response to the browser. Ths can act as a "port forwarder" - but this only operates on an application level, in this case, HTTP.
c) port forwarding can also be done at a lower level that'll pass all, or some connections to the port. IPTables is a great solution for this: Linux Port Forwarding Using iptables - SysTutorials. This is the solution you want if you're not forwarding HTTP traffic

The implication for c) is that all traffic that matches the rule will get forwarded. Since you're on 80, all HTTP traffic will be forwarded to 7272, whether you want to or not. Therefore, if you've also got Apache listening on the IP you want to port-forward, Apache will no longer server the requests as the firewall steps in before Apache even gets the request.
 
Back
Top