-
-
Save yko/911fea4ce47558d74344 to your computer and use it in GitHub Desktop.
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
# ... | |
sub startup { | |
my $self = shift; | |
$self->hook( | |
before_dispatch => sub { | |
my $c = shift; | |
warn $c->req->to_string; | |
my $base = Mojo::URL->new(scalar $c->req->headers->header('X-Proxy-Path')); | |
$c->req->url->base( $base ); | |
} | |
); | |
} | |
# ... |
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
# ... | |
http { | |
# ... | |
upstream test { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen *:80; | |
location /test { | |
proxy_pass http://test/$request_uri; | |
proxy_set_header X-Proxy-Path "/test"; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_connect_timeout 120; | |
proxy_send_timeout 120; | |
proxy_read_timeout 180; | |
} | |
} | |
# ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment