51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name nextcloud.timothykim.net;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name nextcloud.timothykim.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/nextcloud.timothykim.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/nextcloud.timothykim.net/privkey.pem;
|
|
|
|
include /etc/nginx/conf.d/security-headers.inc;
|
|
|
|
# Nextcloud file uploads can be up to 20G
|
|
client_max_body_size 20G;
|
|
# Stream uploads directly to Nextcloud instead of buffering to disk first
|
|
proxy_request_buffering off;
|
|
proxy_buffering off;
|
|
|
|
set $upstream_nextcloud http://nextcloud:80;
|
|
|
|
location / {
|
|
proxy_pass $upstream_nextcloud;
|
|
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;
|
|
}
|
|
|
|
# Nextcloud requires these redirects for CalDAV/CardDAV client discovery
|
|
location /.well-known/carddav {
|
|
return 301 /remote.php/dav;
|
|
}
|
|
|
|
location /.well-known/caldav {
|
|
return 301 /remote.php/dav;
|
|
}
|
|
}
|