9f923b4f35
Static site (no build step) with a browser terminal, plain-text output for curl, and plain k8s manifests under k8s/ for ArgoCD.
43 lines
1006 B
Nginx Configuration File
43 lines
1006 B
Nginx Configuration File
# 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;
|
|
}
|
|
}
|