[Solved]Problem with Nginx


#1

Hello, I don’t know if there is a french section for this forum, so I post here.

My problem is that I wanted to renew my letsencrypt certificat on my server (yunohot) by following a tutorial(both in English and French).

But the command line to renew did’nt work and I got something like this:
Updating letsencrypt and virtual environment dependencies......Command "/root/.local/share/letsencrypt/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jtKEQ5/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fWg4Ya-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.local/share/letsencrypt/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-build-jtKEQ5/cryptography

So I tried to re-install letsencrypt and a new certificat (by following still the same tutorial as much as I could), but my nginx didn’t like it and tell me this:
nginx: [emerg] duplicate location "/.well-known/acme-challenge" in /etc/nginx/conf.d/NdD.tld.conf:9 nginx: configuration file /etc/nginx/nginx.conf test failed
I finally reboot my server, and I can’t access my website, my certificate is over, but I can still access by ssh.

I don’t know how to resolv this problem =/

Librement vôtre.

I also asked on Yunohost forum, and my server works well! (it’s there)


#2

Hi,

If I understand ( from the other forum) correctly, you have a new certificate ( /etc/letsencrypt/live/NdD.tld/fullchain.pem. Your cert will expire on 2016-06-06. )

So the only thing now is to correct the issue in your nginx config and restart nginx.

Are there any errors shown in the logs for nginx which indicate why it failed to restart ? From the information above it’s mainly because on line 9 of /etc/nginx/conf.d/NdD.tld.conf you have a duplicate line relating to .well-known/acme-challenge. Can you comment out that line and try restarting nginx ?

If that doesn’t work - are you happy to paste your nginx config file ?