osx - Nginx server for static content -
what minimum needed start nginx server serve static content (js etc)?
i've got:
http { server { listen 80; location / { root /users/matt/dev; } } } events { worker_connections 1024; }
but get:
forbidden
you don't have permission access / on server.
i've run sudo nginx -s reload
with config can access individual files. can example.com/example.js
(try , can see works).
with example.com
want show content of root directory (/users/matt/dev
) disabled. enable use autoindex
:
location / { root /users/matt/dev; autoindex on; }
see more information here:
the ngx_http_autoindex_module module processes requests ending slash character (‘/’) , produces directory listing.
Comments
Post a Comment