aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/etc/nginx/vhosts.conf.nfs_server
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-10-22 22:01:49 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-10-22 22:01:49 -0400
commitf9301e0fe52313581920026a186955c78fcbe831 (patch)
tree9a9d8ea8df1bbf2e5d1253d2398ad469acd96b12 /files/usr/local/etc/nginx/vhosts.conf.nfs_server
parent39358af4e65a0bcd193797ac5003b0adc9b4225b (diff)
downloadinfrastructure-f9301e0fe52313581920026a186955c78fcbe831.tar.gz
zfs autosnapshots, syncthing, pam cleanup
Diffstat (limited to 'files/usr/local/etc/nginx/vhosts.conf.nfs_server')
-rw-r--r--files/usr/local/etc/nginx/vhosts.conf.nfs_server38
1 files changed, 38 insertions, 0 deletions
diff --git a/files/usr/local/etc/nginx/vhosts.conf.nfs_server b/files/usr/local/etc/nginx/vhosts.conf.nfs_server
new file mode 100644
index 0000000..e6fa55b
--- /dev/null
+++ b/files/usr/local/etc/nginx/vhosts.conf.nfs_server
@@ -0,0 +1,38 @@
+$(for user in ${syncthing_users:-}; do cat <<EOF
+upstream syncthing_${user} {
+ server unix:///var/run/syncthing/${user}/syncthing.sock;
+}
+
+EOF
+done)
+
+server {
+ listen 443 ssl default_server;
+ listen [::]:443 ssl default_server;
+ http2 on;
+
+ ssl_certificate ${syncthing_https_cert};
+ ssl_certificate_key ${syncthing_https_key};
+
+ add_header Strict-Transport-Security "max-age=63072000" always;
+
+ auth_gss_keytab ${nginx_keytab};
+ auth_gss_allow_basic_fallback off;
+
+$(for user in ${syncthing_users:-}; do cat <<EOF
+ location /${user}/ {
+ proxy_http_version 1.1;
+ proxy_set_header Connection "";
+ proxy_set_header Host \$host;
+ proxy_set_header X-Real-IP \$remote_addr;
+ proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto \$scheme;
+ proxy_read_timeout 600s;
+ proxy_send_timeout 600s;
+ proxy_pass http://syncthing_${user}/;
+ auth_gss on;
+ auth_gss_authorized_principal ${user};
+ }
+EOF
+done)
+}