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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -