Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function "exists" not working for symlink #226

Open
pvlg opened this issue Nov 20, 2016 · 1 comment
Open

Function "exists" not working for symlink #226

pvlg opened this issue Nov 20, 2016 · 1 comment

Comments

@pvlg
Copy link

pvlg commented Nov 20, 2016

I use symlink for certificate letsencrypt

ln -s /etc/letsencrypt/live/example.com/fullchain.pem /etc/nginx/certs/example.com.crt
ln -s /etc/letsencrypt/live/example.com/privkey.pem /etc/nginx/certs/example.com.key

Function "exists" can not find a certificate.

@jekewa
Copy link

jekewa commented Dec 29, 2021

This won't work because inside the container, your host's /etc/letsencrypt/archive folder is not available.

While /etc/letsencrypt/live/example.com is a real folder, /etc/letsencrypt/live/example.com/fullchain.pem is a symlink to /etc/letsencrypt/archive/example.com/fullchain??.pem (where the ?? is whatever version of cert is your current one). Same with the privkey.pem file. That symlink cannot be followed from within the container.

You could make a hard-link (ln without the -s) to the cert file, but you would have to recreate that every time your certificate is updated.

What would be great would be if this container would use the /etc/letsencrypt structure to find the certificates. The /etc/letsencrypt folder from the host (or shared volume with one of the many letsencrypt maintenance containers) could be mounted in this container, and the certificates could be indicated and found within that folder, using the /etc/letsencrypt/live/$LETSENCRYPT_HOST path, and the symlink to the right ../../archive/ folder could be followed.

Even with this, the container (or at least nginx within) needs to be restarted when the certificates are renewed, but at least the path doesn't need to be re-linked to keep it whole. Perhaps some other trigger to drop and reload that domain's config could be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants