author | Luke Hoersten <luke@hoersten.org> |
Sun, 04 Feb 2024 20:27:19 -0600 | |
changeset 227 | 2e0366f2dcbe |
parent 202 | 252069788104 |
permissions | -rw-r--r-- |
119 | 1 |
server { |
2 |
listen 80; |
|
3 |
server_name {{nginx_server_name}}; |
|
4 |
return 301 https://$host$request_uri; |
|
5 |
} |
|
6 |
||
163 | 7 |
# Enable SSL session caching for improved performance |
8 |
ssl_session_cache shared:ssl_session_cache:10m; |
|
9 |
||
119 | 10 |
server { |
163 | 11 |
listen {{nginx_server_port}} ssl http2; |
119 | 12 |
server_name {{nginx_server_name}}; |
13 |
||
14 |
ssl_certificate {{nginx_ssl_cert}}; |
|
15 |
ssl_certificate_key {{nginx_ssl_privkey}}; |
|
163 | 16 |
include /etc/letsencrypt/options-ssl-nginx.conf; |
17 |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; |
|
119 | 18 |
|
163 | 19 |
ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1; |
20 |
ssl_stapling on; |
|
21 |
ssl_stapling_verify on; |
|
119 | 22 |
|
163 | 23 |
gzip_vary on; |
24 |
gzip_proxied any; |
|
25 |
gzip_comp_level 6; |
|
26 |
gzip_buffers 16 8k; |
|
27 |
gzip_http_version 1.1; |
|
28 |
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml; |
|
119 | 29 |
|
163 | 30 |
# the nginx default is 1m, not enough for large media uploads |
31 |
client_max_body_size 16m; |
|
119 | 32 |
|
163 | 33 |
proxy_set_header Host $host; |
34 |
proxy_set_header X-Real-IP $remote_addr; |
|
35 |
proxy_set_header X-Forwarded-For $remote_addr; |
|
36 |
proxy_set_header X-Forwarded-Proto $scheme; |
|
37 |
proxy_read_timeout 600; |
|
38 |
||
39 |
location /_matrix { |
|
202
252069788104
Backed out changeset 10051617d075
Luke Hoersten <luke@hoersten.org>
parents:
200
diff
changeset
|
40 |
proxy_pass http://127.0.0.1:{{nginx_proxy_port}}; |
119 | 41 |
} |
167
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
42 |
|
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
43 |
root /var/www/{{nginx_server_name}}; |
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
44 |
index index.html; |
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
45 |
|
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
46 |
location / { |
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
47 |
try_files $uri $uri/ =404; |
e3c49bf5fae9
Added index to dendrite nginx template.
Luke Hoersten <luke@hoersten.org>
parents:
163
diff
changeset
|
48 |
} |
119 | 49 |
} |