1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Custom Nginx Vhost Files to allow JS Apps to Run

Discussion in 'Plesk 11.x for Linux' started by Joe90k, Sep 24, 2012.

  1. Joe90k

    Joe90k New Pleskian

    10
     
    Joined:
    Sep 24, 2012
    Messages:
    1
    Likes Received:
    0
    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
     
  2. Alexey.Plotnitsky

    Alexey.Plotnitsky Regular Pleskian

    16
    55%
    Joined:
    Jan 19, 2012
    Messages:
    218
    Likes Received:
    3
    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
     
  3. ShoneA

    ShoneA Basic Pleskian

    22
    40%
    Joined:
    Mar 23, 2010
    Messages:
    61
    Likes Received:
    0
    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.
     
  4. Alexey.Plotnitsky

    Alexey.Plotnitsky Regular Pleskian

    16
    55%
    Joined:
    Jan 19, 2012
    Messages:
    218
    Likes Received:
    3
    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
     
Loading...