0

I'm worried that this question may be one that could be answered very simply if I just knew what to look for, so I apologise if this is something that's been addressed

I've set up a production web server for a Django app using nginx and uwsgi. It's got a let's encrypt SSL certificate installed, and now I'd like to automate the renewal.

I used the method referenced in this article to add the certificate: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 by adding the .well-known directory to the server block.

location ~ /.well-known {
            allow all;
    }

I've tried to keep this but the /.well-known is now 403 forbidden from nginx when the rest of the server config is added (provided below)

Can anyone tell me what I've done wrong or how to solve this?

here's the server config file:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name www.website.co.uk;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    include snippets/ssl-website.co.uk.conf;
    include snippets/ssl-params.conf;

    location /.well-known/ {
        root /home/user/website;
        allow all;
     }

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/user/website;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass  unix:/home/user/website/website.sock;
    }
}

Thanks in advance. I'm still quite new to this and trying to learn.

1 Answer 1

0

i had a similar problem. This answer was my solution. https://stackoverflow.com/a/38949101/4098053

I hope this will help you too!

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the answer, but unfortunately that's still generating a 403 for me. Do you have any idea why else there might be this error?
Do you have check the permissions of the folders?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.