• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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 Change website listening port

JanikoG

New Pleskian
Hi all,
I want to change the http port for only one of my website.
Example : I want to access to one website with http(s)://mywebsite:9999 instead of http(s)://mywebsite
I know I can change manually the nginx config files, but that kind of update is not permanent for the config file is automatically generated.
Any idea ?
 
Unfortunately it's not exactly what I meant: I want to keep the 80/443 for all my sites except for one of them for which I want to set 1111/1112 for example.
I could change it in /var/www/vhosts/system/<mydomain>/conf/nginx.conf but the configuration will be overwriten sooner or later.
 
You can define your special nginx settings with custom virtual host template Changing Virtual Hosts Settings Using Configuration Templates
But note that this solution will affect all your newly created sites.
I tried this method but it failed. I am using Nginx as a full front-line server (and not as a proxy to Apache). I wanted to install Varnish in front of Nginx so I tried to change the listening port for Nginx from 80 to 8800 using templates. It simply does NOT work, no matter what I do. Nginx always takes over port 80 and blocks Varnish from starting and it simultaneously begins listening on port 8800 as well.

I edited the following files, preserving the directory structure:

nginxDomainForwardingIpDefault.php
nginxDomainForwarding.php
nginxDomainVhostIpDefault.php
nginxDomainVhost.php
nginx.php
nginxWebmail.php

I changed the following lines in all the 6 files wherever it was occurring:

'ssl' => false,
'frontendPort' => $VAR->server->nginx->httpPort,

'ssl' => true,
'frontendPort' => $VAR->server->nginx->httpsPort,

Changed to this:

'ssl' => false,
'frontendPort' => "8800",

'ssl' => true,
'frontendPort' => "8801",

Here are the commands I used:

# mkdir /usr/local/psa/admin/conf/templates/custom/
# cp /usr/local/psa/admin/conf/templates/default/nginx* /usr/local/psa/admin/conf/templates/custom/
# mkdir /usr/local/psa/admin/conf/templates/custom/webmail/
# cp /usr/local/psa/admin/conf/templates/default/webmail/nginxWebmail.php /usr/local/psa/admin/conf/templates/custom/webmail/

And of course after all the changes I restarted Nginx but it still binds to port 80 and 8800 at the same time. So I had to delete the custom templates and revert to the original setup until I get proper answers or directions.

I am on ‪Ubuntu 18.04.3 LTS‬ and Plesk Onyx 17.8.11 Update #81
 
Customized templates will be applied only for newly created domains if I'm not mistaken. Have you checked this?
 
Customized templates will be applied only for newly created domains if I'm not mistaken. Have you checked this?
The domain is not new as it is an existing site. How will any new domain work since Nginx always takes over port 80 because the configuration is server-wide and not domain specific? Adding a new domain won't change the status of port 80. So what method can I use to remove Nginx from port 80?
 
Back
Top