Wpis z mikrobloga

Mam nginx proxy, który obsługuje nexcloud. Zgodnie z dokumentacją chciałem użyć tego kodu, żeby obsługiwać dav

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/acme-challenge { tryfiles $uri $uri/ =404; }
location /.well-known/pki-validation { try
files $uri $uri/ =404; }

##NIE DZIAŁA, powinno weryfikować domenę, webroot
location = /.well-known/acme-challenge { allow all; defaulttype "text/plain"; root /usr/share/nginx/html; }

# 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;
}

Ale gryzie się z tym (to niżej działa jesli zakomentuje to, co jest wyżej):

location ~ /\.well-known/acme-challenge {
allow all;
default_type "text/plain";
root /usr/share/nginx/html;
}

Jak połączyć te dwie reguły w jeden DIZAŁAJĄCY blok?

#linux #nginx #sysadmin
  • Odpowiedz