Hi Stuart, > On 9 Aug 2017, at 14:08, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2017-08-09, Maurizio De Magnis <r...@olisti.co> wrote: >> server { >> server_name myapp.com; >> access_log /var/www/apps/my_app/logs/access.log; >> error_log /var/www/apps/my_app/logs/error.log; >> root /var/www/apps/my_app/current; >> location / { >> proxy_pass http://unix:/var/www/apps/my_app/application.socket; > > That seems wrong, why would you have http://unix:/…?
That’s per the documentation of proxy_pass: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass I get a syntax error `doas nginx -t` when I use `proxy_pass unix:/mypath`. I need to either set the “https://" or “https://" prefix. >> Do you have any suggestions on how to implement a unix socket connection >> with NGINX chroot enabled? > > You may need to use the path inside the chroot (/apps/... rather than > /var/www/apps/…), And that nails it in the head! :-) The path is actually related to the inner chroot environment (`/var/www` in my case). #duh I reset the flags, updated the socket path and now it works. Thanks a lot <3 > especially if you reload rather than restart nginx to reconfigure. I don’t understand this piece, could you expand it a bit further? > But it might be simpler to just add symlinks so that > the path /var/www/whatever works whether you're inside or outside the > chroot: > > cd /var/www > mkdir var > ln -s .. var/www Thanks for this advice as well but I think I’ll opt for the simpler chroot-only use case :-)