Is it possible to configure Nginx to allow for new domains to be added without me having to add a VirtualHost for each?
Mark the server
section you want to use as the default using the listen
directive, so that nginx uses that if there are no matching server_names
. It sounds like you're always proxying to an application and that application knows how to handle the different hosts, but if necessary you can use the $host
variable in your nginx configuration.
listen 80 default_server;