Last active
November 11, 2015 23:04
-
-
Save kmjones1979/bc39809ac76f10fd301a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
http { | |
geo $subnet { | |
default 0; | |
45.55.0.0/24 1; | |
} | |
map $subnet $value { | |
default ""; | |
1 $remote_addr; | |
} | |
} | |
server { | |
... | |
proxy_set_header Subnet $value; | |
proxy_pass http://upstream; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This configuration can be used to determine a clients address within a specific subnet and add a header with the $remote_addr variable within NGINX