Files
parasol-static-site/default.conf.tmpl
stevensting 8656d0a6e2 add optional deployment on a staging subdomain (#20)
<!--
Thank you for doing recipe maintenance work!
Please mark all checklist items which are relevant for your changes.
Please remove the checklist items which are not relevant for your changes.
Feel free to remove this comment.
-->

* [x] I have deployed and tested my changes
* [x] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash)
* [x] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes)
* [x] I ran `abra recipe lint parasol-static-site --chaos` on the PR's branch and fixed the warnings.
* [x] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)

Reviewed-on: #20
Co-authored-by: stevensting <stefan@klasse-methode.it>
Co-committed-by: stevensting <stefan@klasse-methode.it>
2026-08-07 06:50:02 +00:00

77 lines
2.2 KiB
Cheetah
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name {{ env "DOMAIN" }};
root /usr/share/nginx/website;
index index.html;
location / {
{{ if eq (env "AUTH_SITE_ENABLED") "1" }}
auth_basic "Site access restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
{{ end }}
try_files $uri $uri/index.html =404;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
# max-age must be in seconds
add_header Cache-Control "max-age=2629746, public";
}
# CSS and Javascript
location ~* \.(?:css|js|ttf|otf|woff2|woff)$ {
expires 1y;
access_log off;
add_header Cache-Control "max-age=31556952, public";
}
location /deploy {
{{ if eq (env "AUTH_ENABLED") "1" }}
auth_basic "Administrator’s Area";
auth_basic_user_file /etc/nginx/.htpasswd;
{{ end }}
proxy_pass http://badger:8080;
}
}
{{ if (env "HUGO_GIT_BRANCH_STAGING") }}
server {
listen 80;
server_name staging.{{ env "DOMAIN" }};
root /usr/share/nginx/website-staging;
index index.html;
location / {
{{ if eq (env "AUTH_SITE_STAGING_ENABLED") "1" }}
auth_basic "Site access restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
{{ end }}
try_files $uri $uri/index.html =404;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
# max-age must be in seconds
add_header Cache-Control "max-age=2629746, public";
}
# CSS and Javascript
location ~* \.(?:css|js|ttf|otf|woff2|woff)$ {
expires 1y;
access_log off;
add_header Cache-Control "max-age=31556952, public";
}
location /deploy {
{{ if eq (env "AUTH_STAGING_ENABLED") "1" }}
auth_basic "Administrator’s Area";
auth_basic_user_file /etc/nginx/.htpasswd;
{{ end }}
proxy_pass http://badger-staging:8080;
}
}
{{ end }}