Bruno Quintana
New Pleskian
I have noticed that none of the docker's containers that I am using from Plesk are able to renew/install the certificate, and this is basically because the url /.well-known/acme-challenge... is 404
I did some research, and I have found that one workaround could be to configure Nginx to serve that file instead of doing the reverse proxy.
The problem with that, is that the file to configure this is automatically generated by Plesk, and if I try to do it from the fronend I get an error that the configuration is duplicated.
The actually autogenerated file has this:
...
#extension letsencrypt begin
location /.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
deny all;
}
}
#extension letsencrypt end
...
And I would like to do allow all:
#extension letsencrypt begin
location /.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
allow all;
}
}
#extension letsencrypt end
But when I add this to
"Additional nginx directives"
I get this error:
Invalid nginx configuration: nginx: [emerg] duplicate location "/.well-known/acme-challenge/" in /var/www/vhosts/system/xx/conf/vhost_nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed
Any ideas?
I did some research, and I have found that one workaround could be to configure Nginx to serve that file instead of doing the reverse proxy.
The problem with that, is that the file to configure this is automatically generated by Plesk, and if I try to do it from the fronend I get an error that the configuration is duplicated.
The actually autogenerated file has this:
...
#extension letsencrypt begin
location /.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
deny all;
}
}
#extension letsencrypt end
...
And I would like to do allow all:
#extension letsencrypt begin
location /.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;
types { }
default_type text/plain;
satisfy any;
auth_basic off;
allow all;
location ~ ^/\.well-known/acme-challenge.*/\. {
allow all;
}
}
#extension letsencrypt end
But when I add this to
"Additional nginx directives"
I get this error:
Invalid nginx configuration: nginx: [emerg] duplicate location "/.well-known/acme-challenge/" in /var/www/vhosts/system/xx/conf/vhost_nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed
Any ideas?