ansible-edda/playbooks/files/services/deploy/lrproxy/nginx-conf.d/cloud.thenineworlds.net.conf

73 lines
2.2 KiB
Plaintext
Raw Normal View History

2022-11-03 00:25:43 +01:00
server {
2023-07-29 14:38:57 +02:00
listen [::]:80;
2022-11-03 00:25:43 +01:00
listen 80;
2024-02-04 19:00:30 +01:00
server_name cloud.thenineworlds.net;
2022-11-03 00:25:43 +01:00
location ^~ /.well-known {
allow all;
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
2023-08-17 17:09:30 +02:00
listen [::]:8443 ssl proxy_protocol;
listen 8443 ssl proxy_protocol;
2024-02-04 19:00:30 +01:00
server_name cloud.thenineworlds.net;
2022-11-03 00:25:43 +01:00
2024-02-04 19:00:30 +01:00
ssl_certificate /etc/letsencrypt/live/cloud.thenineworlds.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cloud.thenineworlds.net/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/cloud.thenineworlds.net/chain.pem;
2022-11-03 00:25:43 +01:00
2023-08-17 17:09:30 +02:00
set_real_ip_from {{ services_all_services.rproxy.inet_address }};
set_real_ip_from {{ services_all_services.rproxy.inet6_address }};
set_real_ip_from {{ services_all_services.lrproxy.inet_address }};
set_real_ip_from {{ services_all_services.lrproxy.inet6_address }};
real_ip_header proxy_protocol;
2023-04-07 23:24:53 +02:00
# Values copied and adjusted from
# https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html.
client_max_body_size 0;
2022-11-04 11:02:04 +01:00
client_body_timeout 3600s;
client_body_buffer_size 512k;
2022-11-04 11:02:04 +01:00
# Otherwise downloads are limited to 1 GB
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/big_file_upload_configuration.html
proxy_buffering off;
2022-11-03 00:25:43 +01:00
# Redirect rules copied from
# https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html.
location ^~ /.well-known {
location = /.well-known/webfinger {
2023-08-17 17:09:30 +02:00
return 301 $scheme://$host:443/index.php$uri;
2022-11-03 00:25:43 +01:00
}
location = /.well-known/nodeinfo {
2023-08-17 17:09:30 +02:00
return 301 $scheme://$host:443/index.php$uri;
2022-11-03 00:25:43 +01:00
}
location = /.well-known/carddav {
2023-08-17 17:09:30 +02:00
return 301 $scheme://$host:443/remote.php/dav;
2022-11-03 00:25:43 +01:00
}
location = /.well-known/caldav {
2023-08-17 17:09:30 +02:00
return 301 $scheme://$host:443/remote.php/dav;
2022-11-03 00:25:43 +01:00
}
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://pod-cloud;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}