Skip to content

Commit

Permalink
Merge pull request #246 from HSLdevcom/remove-default-location
Browse files Browse the repository at this point in the history
Return 404 by default if host doesn't match anything
  • Loading branch information
vesameskanen authored Jan 26, 2024
2 parents 14658aa + 983ed19 commit 9e8cbeb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,26 @@ http {
# to get rid of a warning about server_names_hash building
server_names_hash_bucket_size 128;

server {
listen 8080 default_server;

# Health check
location = / {
root /opt/nginx/www;
index index.html;
}

location / {
return 404;
}
}

# API endpoints
# These domains handle only api calls, not UI
# a-,b-,c- prefixes are ment to be used with map raster image multidomain support
server {
server_name api.digitransit.fi
dev-api.digitransit.fi
"";
dev-api.digitransit.fi;

listen 8080;
include common.conf;
Expand Down

0 comments on commit 9e8cbeb

Please sign in to comment.