• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Custom Nginx Vhost Files to allow JS Apps to Run

Joe90k

New Pleskian
I am trying to allow a certain site to read (and possibly write) from/to /var/apps

I know that the nginx and vhost files can be altered using the php template files, however I am only looking to modify it for one domain and two sub-domains. Is this possible? If so what do I need to do? I am attempting to make the frontend nginx conf files redirect to an upstream front end javascript app that is located in /var/apps which is the default directory for node. Currently though the only aloud directories are /var/www/vhosts/my-domain.com/httpdocs/

Thanks!
Joe
 
Hi Joe,

You can add custom include directive into default php template for Nginx vhost.
Thus, if a specific website will have that custom include config file - it will be included.

There you can _try_ to set your own proxy_pass
 
Can you explain how we add custom nginx conf content? Every time I add something it gets overwritten by the update process.

Example:
------------------

in:
templates/default/domain/nginxDomainVirtualHost.php
templates/default/domain/nginxForwarding.php

added:
include /var/www/vhosts/<?php echo $VAR->domain->wildcardName ?>/conf/custom_nginx/*.conf;

I also tried editing 'templates/default/nginx.php' but I don't think I did it right. Regardless of right or wrong, all these edits were removed on the Feb. 14 Micro-Update.
 
Hi ShoneA,

You should not modify default template files - they become overwritten during upgrade.

Instead, copy default templates to
/usr/local/psa/admin/conf/templates/custom

and there modify them:
/usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
/usr/local/psa/admin/conf/templates/custom/domain/nginxForwarding.php
 
Back
Top