biff

kpassapk 2024-03-19T19:18:06.024559Z

(Possibly dumb) question about server-setup: how does the nginx user have access to the contents of /home/app? I am adapting the example to my use case, but running into permissions issues.

kpassapk 2024-03-19T19:19:05.897629Z

I think the nginx worker runs as www-data . If I poke around as that user by doing

$ sudo su -l www-data -s /bin/bash
$ whoami
  www-data
$ ls /home/app
  ls: cannot open directory '/home/app': Permission denied
I would seem to not be able to access the static files.

kpassapk 2024-03-19T19:23:10.545179Z

The starter application works fine; my related app, with a config I created from scratch, does not. I'm trying to find the missing detail.

2024-03-19T19:32:25.902889Z

The server-setup.sh script just has the starter app serve static files through Jetty like any other request, so nginx doesn't access the files directly. That could be a good optimization to make, though. In the past I think I've typically put static files in /var/www/ or somewhere like that, and then made a symlink to that from the app user's directory.

👍 1
kpassapk 2024-03-19T21:28:05.536609Z

Ah, makes total sense, thanks @foo .

👌 1