49 lines
1.7 KiB
Text
49 lines
1.7 KiB
Text
server {
|
|
listen 80;
|
|
listen 443 ssl;
|
|
server_name cloud.*;
|
|
|
|
include /config/nginx/ssl.conf;
|
|
add_header Front-End-Https on;
|
|
|
|
add_header X-Robots-Tag "noindex, nofollow" always;
|
|
add_header Referrer-Policy no-referrer-when-downgrade;
|
|
|
|
|
|
location / {
|
|
include /config/nginx/resolver.conf;
|
|
include /config/nginx/proxy.conf;
|
|
proxy_set_header X-Forwarded-Host cloud.mcknight.tech;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Ssl on;
|
|
proxy_pass https://Nextcloud:443/;
|
|
}
|
|
|
|
# location /.well-known/caldav {
|
|
# return 301 $scheme://$host/remote.php/dav;
|
|
# }
|
|
#
|
|
# location /.well-known/webfinger {
|
|
# return 301 $scheme://$host/index.php/.well-known/webfinger;
|
|
# }
|
|
|
|
# Make a regex exception for `/.well-known` so that clients can still
|
|
# access it despite the existence of the regex rule
|
|
# `location ~ /(\.|autotest|...)` which would otherwise handle requests
|
|
# for `/.well-known`.
|
|
location ^~ /.well-known {
|
|
# The rules in this block are an adaptation of the rules
|
|
# in `.htaccess` that concern `/.well-known`.
|
|
|
|
location = /.well-known/carddav { return 301 /remote.php/dav/; }
|
|
location = /.well-known/caldav { return 301 /remote.php/dav/; }
|
|
location ^~ /.well-known { return 301 /index.php$uri; }
|
|
|
|
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
|
|
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
|
|
|
|
# Let Nextcloud's API for `/.well-known` URIs handle all other
|
|
# requests by passing them to the front-end controller.
|
|
return 301 /index.php$request_uri;
|
|
}
|
|
}
|