Skip to content

Instantly share code, notes, and snippets.

@jbking
Created May 10, 2015 11:39
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 jbking/de1c8faca037afa30adf to your computer and use it in GitHub Desktop.
Save jbking/de1c8faca037afa30adf to your computer and use it in GitHub Desktop.
proxy to same location but via different path with logging each other.
error_log logs/error.log error;
http {
access_log logs/access.log combined;
server {
listen 8081;
root /tmp/;
}
server {
listen 8080;
location /1/ {
proxy_pass http://localhost:8081;
access_log logs/access_via_1.log combined;
rewrite /1(/.+) $1 break;
}
location /2/ {
proxy_pass http://localhost:8081;
access_log logs/access_via_2.log combined;
rewrite /2(/.+) $1 break;
}
}
}
events {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment