Skip to content

Instantly share code, notes, and snippets.

@npeters
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npeters/977a3699b657c67eccb2 to your computer and use it in GitHub Desktop.
Save npeters/977a3699b657c67eccb2 to your computer and use it in GitHub Desktop.
nginx router
# map http://nginx.org/en/docs/http/ngx_http_map_module.html#map
# dns https://www.jethrocarr.com/2013/11/02/nginx-reverse-proxies-and-dns-resolution/
# http://www.senginx.org/en/index.php/Dynamic_DNS_Resolve
events {
worker_connections 4096; ## Default: 1024
}
http {
index index.html index.htm index.php;
map $http_x_domain $serveroute {
default "toto";
N4 "http://www.google.fr";
N5 "http://www.google.com";
}
server {
listen 11182;
server_name localhost;
resolver 8.8.8.8;
location / {
proxy_pass $serveroute;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment