Last active
May 18, 2017 14:35
-
-
Save stampycode/f11bc2b3799191d74513f0f213ffb20b to your computer and use it in GitHub Desktop.
NGinx multi-docker-container reverse proxy config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events { | |
worker_connections 1024; | |
} | |
http { | |
resolver 127.0.0.11; | |
server { | |
server_name ~^(?<ctrn>[^\.]+)-(qa|dev)\.; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
set $pp "http://$ctrn"; | |
proxy_pass $pp; | |
} | |
} | |
server { | |
server_name ~^(?<ctrn>[^\.]+); | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
set $pp "http://$ctrn"; | |
proxy_pass $pp; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment