skip to Main Content

Changing the default http port on nginx with Plesk 12.5 is my biggest problem I know how to set up Varnish.
I also know to do this on the server with out the Plesk.
My OS is Debian 8.3, I wind some instructions for Centos but they were unhelpful to me.

2

Answers


  1. There is two ways

    1. Official with trade-offs:

      customizing Plesk’s web server configs templates as described here https://talk.plesk.com/threads/solved-help-required-change-nginx-port.331439/

      You have to starts with creating folder /usr/local/psa/admin/conf/templates/custom and copying following files from /usr/local/psa/admin/conf/templates/default:

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

      and replace $VAR->server->nginx->httpPort in each file with port number you want.

      Trade-offs are: after upgrade to next version you should perform this procedure again. All changes which will be performed by updates for default templates will be not applies to you.

    2. Fast with unknown side effects: just change ports in table ServiceNodeConfiguration:

      mysql -uadmin -pcat /etc/psa/.psa.shadow -Dpsa -e “select * from ServiceNodeConfiguration where section = ‘webProxy'”

      +---------------+----------+-----------------+-------+
      | serviceNodeId | section  | name            | value |
      +---------------+----------+-----------------+-------+
      |             1 | webProxy | enabled         | true  |
      |             1 | webProxy | frontendPort    | 80    |
      |             1 | webProxy | sslFrontendPort | 443   |
      +---------------+----------+-----------------+-------+
      

    And don’t forget for /usr/local/psa/admin/bin/httpdmng --reconfigure-all

    Login or Signup to reply.
  2. This is a good command to change port 80 in database for nginx. Varnish now can work through port 80.

    mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -Dpsa -e "update ServiceNodeConfiguration set value=8080 where section = 'webProxy' and name ='frontendPort'";
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search