• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

[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:
https://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