I'm trying to serve a node app through nginx, but first attempt to serve static files that may be in a /public
folder. I've got that much working -- but when accessing domain.tld/
or the index of static folders, I get a 403; directory index of "/var/www/domain.tld/" is forbidden
. All the permissions seem to correct, so I'm rather confused.
This is my server block;
server {
server_name domain.tld;
location / {
root /var/www/domain.tld/public;
try_files $uri $uri/ @proxy;
access_log off;
}
location @proxy {
proxy_pass http://127.0.0.1:3000;
}
}
Accessing any random page (including assumed sub-directories) properly proxies to the node app. In the case of the root / and root of any existing static directory, however, 403.
Any ideas?