Discover Centmin Mod today
Register Now

Nginx set root path outside /home/nginx

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by yunos, Sep 6, 2019.

  1. yunos

    yunos Member

    130
    3
    18
    Aug 8, 2015
    Ratings:
    +17
    Local Time:
    12:40 AM
    1.8.0
    have a script installed that is setup at /home/yunos but is it possible to edit nginx vhost so root path can be read at /home/yunos?
    tried alias but to no avail

     
  2. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:40 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    You can change nginx vhost web root directive to /home/yunos but all files and directories for /home/yunos need to be owned by nginx user/group for nginx to read them and can't be owned by yunos user/group otherwise nginx can not read or access /home/yunos files/directories
     
  3. yunos

    yunos Member

    130
    3
    18
    Aug 8, 2015
    Ratings:
    +17
    Local Time:
    12:40 AM
    1.8.0
    yeah thats what i thought :/
    could i just assign nginx user to be in the same user group as yunos?

    otherwise i guess i have to expose a port to proxy off instead :/

    location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://localhost:3000;
    }