• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

[Solved] help required - change nginx port

Imad S

New Pleskian
Hey,

I need help in changing the nginx port. I've followed various threads and have created a custom nginxDomainVirtualHost.php file at: /usr/local/psa/admin/conf/templates/custom/domain, while the website indeed moves to the port I have set, a second nginx thread starts at port 80 and takes over in it's place.

I need to put varnish at port 80 and cannot do so until all services relinquish control on port 80.

Help please.

Solved!

Followed clues here:
http://download1.parallels.com/Ples...nistration-guide/index.htm?fileName=68800.htm

some here:
http://talk.plesk.com/threads/step-...and-integrate-varnish-with-plesk-12-x.310544/

Turn's out to be able to change the nginx port to a non-standard port you need to edit 6 files
  • nginx.php
  • nginxDomainForwarding.php
  • nginxDomainForwardingIpDefault.php
  • nginxDomainVhost.php
  • nginxDomainVhostIpDefault.php
  • nginxWebmail.php

For the time being i disabled SSL support for my test domain as I didn't need it. The line you need to look for the in above files is:
Code:
$VAR->server->nginx->httpPort

So the line would finally become from this:
Code:
<?php echo $VAR->includeTemplate('server/nginxVhosts.php', array(
    'ssl' => false,
    'frontendPort' => $VAR->server->nginx->httpPort,
    'backendPort' => $VAR->server->webserver->httpPort,
)) ?>

to this:
Code:
<?php echo $VAR->includeTemplate('server/nginxVhosts.php', array(
    'ssl' => false,
    'frontendPort' => "8888",
    'backendPort' => $VAR->server->webserver->httpPort,
)) ?>

To get this to work you'll need to create a custom directory at: /usr/local/psa/admin/conf/templates
and copy the files over from the root of /usr/local/psa/admin/conf/templates/default


Hope this helps someone.
 
Last edited:
Back
Top