Skip to content

Commit

Permalink
Add default server to nginx configs
Browse files Browse the repository at this point in the history
  • Loading branch information
wakibi committed Nov 22, 2023
1 parent 1b9edf7 commit 8aeb223
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion config/nginx/django.conf.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ upstream green {
{{ end }}
}

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 444;
}

server {
listen 80;

server_name devinit.org www.devinit.org;
server_name devinit.org www.devinit.org dev.devinit.org;

client_max_body_size 100M;

Expand Down
14 changes: 13 additions & 1 deletion config/nginx/django_https.ctmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
server {
listen [::]:443 ssl default_server;
listen 443 ssl default_server;
server_name _;
# Use below to avoid SSL errors on non-existent domains
set $empty "";
ssl_ciphers aNULL;
ssl_certificate data:$empty;
ssl_certificate_key data:$empty;
return 444;
}

server {
listen 443 ssl;
ssl on;
Expand All @@ -8,7 +20,7 @@ server {
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;

server_name www.devinit.org devinit.org;
server_name www.devinit.org devinit.org dev.devinit.org;

client_max_body_size 100M;

Expand Down

0 comments on commit 8aeb223

Please sign in to comment.