Welcome! Log In Create A New Profile

Advanced

Re: location root not working as described

Francis Daly
March 20, 2021 08:16PM
On Sat, Mar 20, 2021 at 03:08:03PM -0700, John Fowler wrote:

Hi there,

> Thank you for your suggestion, but I had tried using the alias as well and that did not work as advertised. The following is the results of using the alias and “^~”.
>
> I do see some odd behavior.
>
> The following access snippet
> 2021/03/20 21:44:21 [error] 14#14: *7 open() "/var/www/certbottest.html" failed (2: No such file or directory), client: 10.0.0.2, server: cyva.lese-fowler.us, request: "GET /.well-known/acme-challenge/test.html HTTP/1.1", host: "cyva.lese-fowler.us"

"alias" does a straight textual swap of the part in "location" for the
part in "alias".

Either both should end in /, or neither should. (Usually, both should.)

> 2021/03/20 21:44:21 [error] 14#14: *7 open() "/var/www/certbottest.html" failed (2: No such file or directory), client: 10.0.0.2, server: cyva.lese-fowler.us, request: "GET /.well-known/acme-challenge/test.html HTTP/1.1", host: "cyva.lese-fowler.us"

> But I don’t know where the certbottest.html is coming from…

The request is /.well-known/acme-challenge/test.html

> location ^~ /.well-known/acme-challenge/ {
> allow all;
> alias /var/www/certbot;
> try_files $uri =405;
> }

The "location" part is "/.well-known/acme-challenge/". Replace that in
the request with the "alias" part of "/var/www/certbot", and you end up
with the configured filename of "/var/www/certbottest.html".

nginx is doing what it was told to do.

The previous suggestion was

> > Probably use "location ^~", but definitely use "alias /var/www/certbot/;".

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

location root not working as described

John Fowler March 20, 2021 06:10PM

Re: location root not working as described

Francis Daly March 20, 2021 08:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready