aboutsummaryrefslogtreecommitdiffstats
path: root/templates/ingress/usr_local_etc_nginx_nginx.conf.j2
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-10-18 23:54:14 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-10-18 23:54:14 +0300
commitfea0aff43b6c7cc14ba848f97afb17999ff65c17 (patch)
treee9d570cb8f7bf31d179ec70dcc2f2c578ff888ab /templates/ingress/usr_local_etc_nginx_nginx.conf.j2
parent468c528ccf05ec448328882e0ee7d69683666309 (diff)
Add goaccess to ingress
Diffstat (limited to 'templates/ingress/usr_local_etc_nginx_nginx.conf.j2')
-rw-r--r--templates/ingress/usr_local_etc_nginx_nginx.conf.j228
1 files changed, 28 insertions, 0 deletions
diff --git a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2
index 38b41d7..0ae1e56 100644
--- a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2
+++ b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2
@@ -11,6 +11,13 @@ http {
sendfile on;
keepalive_timeout 65;
+ log_format vcombined '$host:$server_port '
+ '$remote_addr - $remote_user [$time_local] '
+ '"$request" $status $body_bytes_sent '
+ '"$http_referer" "$http_user_agent"';
+
+ access_log /var/log/nginx/access.log vcombined;
+
server {
listen 80 default_server;
server_name _;
@@ -78,6 +85,27 @@ http {
return 307 https://{{ route.redirect }}$request_uri;
}
+ {% elif route.static is defined -%}
+ server {
+ server_name {{ route.host }};
+ http2 on;
+
+ listen 443 ssl;
+ listen [::]:443 ssl;
+
+ # See https://ssl-config.mozilla.org/#server=nginx&version=1.28.0&config=intermediate&openssl=3.4.0&guideline=5.7
+ add_header Strict-Transport-Security "max-age=63072000" always;
+
+ ssl_certificate /usr/local/etc/letsencrypt/live/{{ route.host }}/fullchain.pem;
+ ssl_certificate_key /usr/local/etc/letsencrypt/live/{{ route.host }}/privkey.pem;
+ include /usr/local/etc/letsencrypt/options-ssl-nginx.conf;
+ ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem;
+
+ location / {
+ root {{ route.static }};
+ index index.html;
+ }
+ }
{% endif %}
{% endfor %}
}