nystudio107 / nginx-craft

An Nginx virtual host configuration for Craft CMS that implements a number of best-practices.
MIT License
310 stars 37 forks source link

Location Directive Not Allowed, Letsencrypt challenge #19

Closed jonlongnecker closed 5 years ago

jonlongnecker commented 5 years ago

Attempting to merge the existing Forge config file with the one provided here and getting this error message:

"location" directive is not allowed here in /etc/nginx/forge-conf/DOMAINREPLACED.com/server/letsencrypt_challenge.conf:1

Looks like it has something to do with an ACME challenge?

letsencrypt_challenge.conf:

location /.well-known/acme-challenge {
auth_basic off;
allow all;
alias /home/forge/.letsencrypt;
}

No idea what's going on :-/

khalwat commented 5 years ago

It probably depends on where in that config file you're putting it. location blocks can only be inside of server and other location blocks: http://nginx.org/en/docs/http/ngx_http_core_module.html#location