Skip to content

Commit

Permalink
Block access requests that do not specify hostname (bots)
Browse files Browse the repository at this point in the history
  • Loading branch information
amplifi committed Jan 17, 2017
1 parent 12e0ab1 commit 69935ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions provision/roles/webserver/production/templates/nginx-production
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ server {
server {
listen 443 ssl;
server_name {{ api_url }};

if ($http_host != "{{ api_url }}") {
return 403;
}

ssl_certificate /etc/ssl/private/domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;

Expand Down Expand Up @@ -61,6 +66,11 @@ server {
server {
listen 443 ssl;
server_name {{ main_url }};

if ($http_host != "{{ main_url }}") {
return 403;
}

ssl_certificate /etc/ssl/private/domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;

Expand Down

0 comments on commit 69935ee

Please sign in to comment.