Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server_name *.hostname.com;
- if ($host ~* ^([0-9]+).hostname.com$) {
- set $proxyhost 192.168.56.$1;
- }
- proxy_pass http://$proxyhost;
- server_name ~^(?<subnum>[0-9]+).hostname.com$;
- proxy_pass http://192.168.56.$subnum;
- map $host $backend {
- default 1;
- ~*^(?P<number>[0-9]+).hostname.com$ $number;
- # FIXME: [0-9]+ must be replaced to regex with accurate check 1..254 range
- # for example [1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4] or similar
- }
- server {
- server_name *.hostname.com;
- location / {
- proxy_pass http://192.168.56.$backend:80;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement