worker_processes 1; daemon off; events { worker_connections 1024; } error_log stderr error; http { types_hash_max_size 4096; include /etc/nginx/mime.types; sendfile on; access_log /dev/stdout; # 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; } } # no auth. rate limit server { server_name localhost; listen 82; root /tmp/shared/images; location / { autoindex on; autoindex_format json; limit_rate 10k; } } # tls server { server_name localhost; listen 443 ssl; ssl_certificate /tmp/shared/certs/tls.crt; ssl_certificate_key /tmp/shared/certs/tls.key; root /tmp/shared/images; location / { autoindex on; autoindex_format json; } } }