# Mounted at /etc/nginx/conf.d/default.conf — everything here is http context. # terminal people get the plain text version of the page map $http_user_agent $root_doc { default /index.html; "~*(curl|wget|httpie|lynx|w3m|nc/)" /hello.txt; } server { listen 8080; server_name _; root /var/www/html; index index.html; absolute_redirect off; gzip on; gzip_types text/css application/javascript text/plain image/svg+xml; gzip_vary on; # index.html is the app itself: never cache it, so a deploy is visible now location = / { try_files $root_doc =404; add_header Cache-Control "no-store"; } location = /index.html { add_header Cache-Control "no-store"; } location = /hello.txt { add_header Cache-Control "no-store"; } location ~* \.(css|js|svg)$ { add_header Cache-Control "public, max-age=604800"; } location / { try_files $uri $uri/ =404; } }