worker_processes 1; daemon off; events { worker_connections 1024; } http { types_hash_max_size 4096; include /etc/nginx/mime.types; sendfile on; # no auth server { server_name localhost; listen 80; root /tmp/shared/images; location / { autoindex on; autoindex_format json; } } # auth server { server_name localhost; listen 81; root /tmp/shared/images; auth_basic "auth test"; auth_basic_user_file /etc/nginx/htpasswd; location / { autoindex on; autoindex_format json; } } }