Join the community 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

    63
    3
    8
    Aug 8, 2015
    Ratings:
    +9
    Local Time:
    3:25 PM
    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

    41,350
    9,279
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,236
    Local Time:
    11:25 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    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

    63
    3
    8
    Aug 8, 2015
    Ratings:
    +9
    Local Time:
    3:25 PM
    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;
    }