I've got nginx 1.8.1 on a server running FreeBSD 10.2. I'm trying to serve files from a subdirectory of /usr/local/www/
(which is default on FreeBSD), but for some reason, requests to the files I'm trying to access always result in a 404.
The file specifically is /usr/local/www/example.com/pubic_html/index.html
, with /usr/local/www
recursively owned by www:www
, the user and group of the nginx worker process, with permissions recusrively set to 755
.
My server
block, in /usr/local/etc/nginx/sites-available/example.com
:
server {
listen 80 default;
server_name example.com www.example.com;
root /usr/local/www/example.com/public_html;
location /app {
proxy_pass http://localhost:8080;
}
location / {
try_files $uri =404;
}
}
I'm honestly puzzled by this. I haven't had this issue on Linux with Nginx or Apache, and I haven't had this issue working with Apache on FreeBSD before, either. How can I get nginx to serve this static file?
EDIT: while requests for static files don't result in anything being logged to my nginx-error.log
, it does result in normal 404 hit records in the nginx-access.log
.