Modify document root for nginx proxy under plesk

瘦欲@ 提交于 2019-12-05 20:02:44

For Plesk 12.0 and above there UI controls to specify domain's additional nginx/apache directives in "Web Server Settings":

For Plesk 11.5 you can add custom directive:

  1. mkdir /usr/local/psa/admin/conf/templates/custom/domain

  2. cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/

  3. add in /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php:

    <?php if (file_exists($VAR->domain->physicalHosting->vhostDir . '/conf/nginx.conf')): ?>
        include <?php echo $VAR->domain->physicalHosting->vhostDir;?>/conf/nginx.conf;
    <?php endif ?>
    
  4. /usr/local/psa/admin/bin/httpdmng --reconfigure-all # to apply new configuration for all domains

As result, if domain has conf/nginx.conf - it will be included into virtual host config.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!