From 530010110e61404a7e2e899c697faca94ce1e06e Mon Sep 17 00:00:00 2001 From: maren Date: Sun, 10 Mar 2024 20:54:58 -0400 Subject: [PATCH] add some nginx configs --- nginx-minimal-proxy-config | 14 ++++++++++++++ nginx-minimal-static-site-config | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 nginx-minimal-proxy-config create mode 100644 nginx-minimal-static-site-config diff --git a/nginx-minimal-proxy-config b/nginx-minimal-proxy-config new file mode 100644 index 0000000..1d0fcf7 --- /dev/null +++ b/nginx-minimal-proxy-config @@ -0,0 +1,14 @@ +# the point of this template is to work cleanly with certbot +# set up your proxied service, create nginx config with this template, +# then run certbot and the resultant config should work correctly + +server { + listen 80; + + server_name your_domain; + + location / { + proxy_pass app_server_address; + include proxy_params; + } +} diff --git a/nginx-minimal-static-site-config b/nginx-minimal-static-site-config new file mode 100644 index 0000000..fc518eb --- /dev/null +++ b/nginx-minimal-static-site-config @@ -0,0 +1,21 @@ +# the point of this template is to work cleanly with certbot +# make a static site, create nginx config with this template, +# then run certbot and the resultant config should work correctly +# +# the cache-control entry is almost definitely something you want +# it is not saying "do not cache", explanation here: +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + +server { + listen 80; + + root /var/www/your_domain; + index index.html; + + server_name your_domain; + + location / { + add_header Cache-Control 'no-cache'; + try_files $uri $uri/ =404; + } +}