• 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.

Resolved Changing domain vhost port for Apache and nginx in Plesk

s.kazimierczak

New Pleskian
Server operating system version
CentOS Linux 7.9.2009 (Core)
Plesk version and microupdate number
Obsidian 18.0.46 Update #2
Hi guys,
Is there a way to change the default port number for Apache and nginx in Plesk Additional Apache & nginx directives?
Changing this value in httpd.conf for vhost will be replaced with any change in Plesk. I want to only change the port for one website. I don't want to create custom templates because I don't want any future websites to use different ports than default ones.
Can anyone help?
Thanks in advance
 
this cannot be done

well, if I think a bit outside the box....
you could create an "Event Handler" in Plesk, that fires on domain updates and executes a shell script that does use something like awk/sed to search and replace the ports in the nginx and apache2 config file of this specific website and then reloads the nginx/apache2 service.
This way it would re-apply your custom ports again, any time you make some changes
 
Hi guys,
Is there a way to change the default port number for Apache and nginx in Plesk Additional Apache & nginx directives?
Changing this value in httpd.conf for vhost will be replaced with any change in Plesk. I want to only change the port for one website. I don't want to create custom templates because I don't want any future websites to use different ports than default ones.
Can anyone help?
Thanks in advance
Did you ever find a solution for this, needing to do something exactly like this?
 
This can be easily solved by a case switch in the template file, e.g. "if ... then".
Is there a way to do this when the domain is already added to Plesk. Or is there a way to change the current configuration for the reverse proxy set up where Apache uses 7081 and nginx uses 443 and change that to make nginx look for 3000 (as an example).
 
Never mind I figured out a solution:
Just went to the specific domain that I wanted changed and disabled nginx proxy mode and then under additional nginx directives in put the following

Code:
location / {
    proxy_pass https://my.ip.addr.here:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
 
Back
Top