diff --git a/nginx.conf.template b/nginx.conf.template index 5bf72a3..5900b6a 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -5,6 +5,9 @@ proxy_cache_path /var/cache/nginx/builds levels=1:2 server { listen 3000; + # Redirect directory requests to index.html + rewrite ^(.*)/$ $1/index.html last; + location / { proxy_pass $BUCKET_ORIGIN; proxy_cache builds; @@ -16,12 +19,18 @@ server { proxy_hide_header x-amz-id-2; proxy_hide_header x-amz-meta-s3cmd-attrs; proxy_hide_header Set-Cookie; + proxy_hide_header Content-Type; proxy_ignore_headers Set-Cookie; proxy_set_header Host $BUCKET_HOST; proxy_set_header Cookie ""; proxy_set_header Authorization ""; + # Let Nginx set Content-Type from file extension + types { } + include /etc/nginx/mime.types; + default_type application/octet-stream; + add_header X-Cache-Status $upstream_cache_status; } }