使用Plesk 12.5更改nginx上的默认http端口是我最大的问题,我知道如何设置Varnish。
我也知道在没有Plesk的情况下在服务器上执行此操作。
我的操作系统是Debian 8.3,我为Centos提供了一些说明,但是它们对我没有帮助。
最佳答案
有两种方式
按照此处 https://talk.plesk.com/threads/solved-help-required-change-nginx-port.331439/ 的描述自定义 Plesk 的 Web 服务器配置模板
您必须首先创建文件夹
/usr/local/psa/admin/conf/templates/custom
并从 /usr/local/psa/admin/conf/templates/default
复制以下文件:nginx.php
nginxDomainForwarding.php
nginxDomainForwardingIpDefault.php
nginxDomainVhost.php
nginxDomainVhostIpDefault.php
nginxWebmail.php
并将每个文件中的
$VAR->server->nginx->httpPort
替换为您想要的端口号。权衡是: 升级到下一个版本后,您应该再次执行此过程。
default
模板的更新将执行的所有更改都不适用于您。 mysql -uadmin -p
cat /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 |
+---------------+----------+-----------------+-------+
不要忘记
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
关于nginx - 如何更改 debian8.3 + plesk 12.5 上的 nginx 端口并在端口 80 上设置 varnish 监听?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36483323/