Skip to content

Does not restore original vhosts configuration #521

@Redsandro

Description

@Redsandro

When using Per-VIRTUAL_HOST configuration, for example to set rewrite or redirect rules, the docker-letsencrypt-nginx-proxy-companion prepends some custom code, and doesn't clean up nor restore the original file afterwards.

The files are left in /etc/nginx/vhost.d with the temporary code prepended, and the entire nginx server won't work.

For example, /etc/nginx/vhost.d/windowsremix.com before starting this companion:

return 301 https://www.windowsremix.com$request_uri;

/etc/nginx/vhost.d/windowsremix.com after this companion:

## Start of configuration add by letsencrypt container
location ^~ /.well-known/acme-challenge/ {
    auth_basic off;
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container
return 301 https://www.windowsremix.com$request_uri;

Removing all custom vhost configuration and restarting the stack brings up the server again. Although of course without custom rewrite or redirect rules.

Metadata

Metadata

Assignees

Labels

kind/bugIssue reporting a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions