diff options
author | Sam Chudnick <sam@chudnick.com> | 2023-06-25 09:52:36 -0400 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2023-06-25 09:52:36 -0400 |
commit | 95b73daa36b23565a8566f71f9b202d3459b685f (patch) | |
tree | cb17b021be70e7868d0ec235a761f0ecdc80f3f2 /data/nextcloud |
Diffstat (limited to 'data/nextcloud')
-rw-r--r-- | data/nextcloud/nextcloud.conf | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/data/nextcloud/nextcloud.conf b/data/nextcloud/nextcloud.conf new file mode 100644 index 0000000..7528dbe --- /dev/null +++ b/data/nextcloud/nextcloud.conf | |||
@@ -0,0 +1,45 @@ | |||
1 | map $http_upgrade $connection_upgrade { | ||
2 | default upgrade; | ||
3 | '' close; | ||
4 | } | ||
5 | |||
6 | server { | ||
7 | listen 443 ssl; | ||
8 | server_name nextcloud.chudnick.com; | ||
9 | |||
10 | ssl_certificate /etc/letsencrypt/live/chudnick.com/fullchain.pem; | ||
11 | ssl_certificate_key /etc/letsencrypt/live/chudnick.com/privkey.pem; | ||
12 | add_header Strict-Transport-Security "max-age=31536000" always; | ||
13 | ssl_stapling on; | ||
14 | ssl_stapling_verify on; | ||
15 | |||
16 | # Security / XSS Mitigation Headers | ||
17 | add_header X-Frame-Options "SAMEORIGIN"; | ||
18 | add_header X-XSS-Protection "1; mode=block"; | ||
19 | add_header X-Content-Type-Options "nosniff"; | ||
20 | |||
21 | location / { | ||
22 | proxy_pass http://localhost:8005; | ||
23 | |||
24 | proxy_set_header Host $host; | ||
25 | proxy_set_header X-Real-IP $remote_addr; | ||
26 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
27 | proxy_set_header X-Forwarded-Proto $scheme; | ||
28 | proxy_set_header X-Forwarded-Protocol $scheme; | ||
29 | proxy_set_header X-Forwarded-Host $http_host; | ||
30 | client_max_body_size 0; | ||
31 | |||
32 | # Websocket | ||
33 | proxy_http_version 1.1; | ||
34 | proxy_set_header Upgrade $http_upgrade; | ||
35 | proxy_set_header Connection $connection_upgrade; | ||
36 | } | ||
37 | |||
38 | } | ||
39 | |||
40 | server { | ||
41 | listen 80; | ||
42 | listen [::]:80; | ||
43 | server_name nextcloud.chudnick.com; | ||
44 | return 301 https://$host$request_uri; | ||
45 | } | ||