0
votes

I have some questions regarding the use of Let's Encrypt with multiple nginxconf files.

.well-known location block

Do I need to put this location block in every nginxconf file, or just in the default nginxconf?

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

My default config file is used for showing the "Nginx is working" page. My other serverblocks, which are in seperate nginxconf files, are used for binding a specific application to a specific domain.

What is my document root?

I serve multiple Django applications on my server. In the Let's Encrypt tutorial they are talking about a document root. Should this be a single document root for all my applications/certificates (for example /var/www/html) or does each application have it's own document root (for example the root folder of my Django application)?

Note: my Django application are NOT in /var/www/html, but in a directory WITHIN my home directory.

1
You need a separate cert for each domain, so I think you'll need the corresponding .well-known per domain.Faisal Memon

1 Answers

0
votes

You have to include 'well-known' location block in every nginx configuration file which needs to be authenticated. So if you have multiple domains to be served using multiple nginx configuration files, you have to put 'well-known' location block in all these files.

Document root is the place where nginx searches for files. /var/www/html is the default document root Eg:

 location ~ /media {
    root /www/media;
}

When you hit URL's like http://my-server/media/image1 then nginx searches files in /www/media path. So you can specify your own document root, if your django applications are in /home/my_django then specify root /home/my_django in the location block.

Note:

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

Nginx searches .well-known in /var/www/html, so specify 'root' directive if you have .well-known in other location.