Updates example nginx config to prevent Crafty being served when a request comes in for a domain that does not match another config. We probably need to document this in the wiki.

See merge request crafty-controller/crafty-commander!141
This commit is contained in:
xithical 2022-01-20 17:13:15 +00:00
commit 85b040e41f

View File

@ -6,13 +6,20 @@ upstream crafty {
}
server {
listen 80 default_server;
listen 80;
server_name <DOMAIN>;
if ($host !~* ^<SUBDOMAIN>\.<EXAMPLE>\.com$ ) {
return 444;
}
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name <DOMAIN>;
if ($host !~* ^<SUBDOMAIN>\.<EXAMPLE>\.com$ ) {
return 444;
}
ssl_certificate <CERIFICATE_LOCATION>;
ssl_certificate_key <KEYFILE_LOCATION>;
location / {