mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-19 20:09:16 +00:00
Use proxy forwarded headers if available for /.well-known redirects
This commit is contained in:
parent
39e5c9c930
commit
3a26ffb087
@ -1,3 +1,13 @@
|
|||||||
|
map $http_x_forwarded_port $nc_port {
|
||||||
|
default "$http_x_forwarded_port";
|
||||||
|
'' "$server_port";
|
||||||
|
}
|
||||||
|
|
||||||
|
map $http_x_forwarded_proto $nc_proto {
|
||||||
|
default "$http_x_forwarded_proto";
|
||||||
|
'' "$scheme";
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 8888;
|
listen 8888;
|
||||||
root /nextcloud;
|
root /nextcloud;
|
||||||
@ -26,11 +36,11 @@ server {
|
|||||||
rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 https://$host/remote.php/dav;
|
return 301 $nc_proto://$host:$nc_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 https://$host/remote.php/dav;
|
return 301 $nc_proto://$host:$nc_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user