78 řádky
2.3 KiB
Nginx Configuration File
78 řádky
2.3 KiB
Nginx Configuration File
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
|
|
server_name cloud.[DOMAIN];
|
|
|
|
ssl_certificate /etc/letsencrypt/live/cloud.[DOMAIN]/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/cloud.[DOMAIN]/privkey.pem;
|
|
|
|
client_max_body_size 0;
|
|
underscores_in_headers on;
|
|
|
|
# Warning HSTS Nextcloud
|
|
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
|
|
|
# Re-resolve upstream DNS names at request time so a container restart
|
|
# (new IP on internal.network) doesn't leave nginx stuck on a stale
|
|
# address until nginx itself is restarted.
|
|
resolver 10.10.0.1 valid=10s;
|
|
resolver_timeout 5s;
|
|
|
|
# Nextcloud Push
|
|
location ^~ /push/ {
|
|
set $nextcloud_push_upstream http://nextcloud-push:7867;
|
|
proxy_pass $nextcloud_push_upstream/;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
proxy_set_header Host $http_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 3600;
|
|
proxy_send_timeout 3600;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location / {
|
|
set $nextcloud_upstream http://nextcloud:80;
|
|
proxy_pass $nextcloud_upstream;
|
|
|
|
proxy_set_header Host $http_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_set_header X-Forwarded-Host $http_host;
|
|
proxy_set_header X-Forwarded-Ssl on;
|
|
|
|
proxy_redirect off;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_max_temp_file_size 0;
|
|
|
|
proxy_read_timeout 3600;
|
|
proxy_send_timeout 3600;
|
|
}
|
|
|
|
location = /.well-known/carddav {
|
|
return 301 https://$http_host/remote.php/dav;
|
|
}
|
|
|
|
location = /.well-known/caldav {
|
|
return 301 https://$http_host/remote.php/dav;
|
|
}
|
|
|
|
location = /.well-known/webfinger {
|
|
return 301 https://$http_host/index.php/.well-known/webfinger;
|
|
}
|
|
|
|
location = /.well-known/nodeinfo {
|
|
return 301 https://$http_host/index.php/.well-known/nodeinfo;
|
|
}
|
|
} |