Welcome! Log In Create A New Profile

Advanced

Re: Help With Locations and Proxying

Maxim Dounin
June 21, 2010 03:16PM
Hello!

On Mon, Jun 21, 2010 at 12:32:16PM -0600, Bryan Richardson wrote:

[...]

> From looking at the debug errors from Nginx, it looks like Nginx is
> trying to pass the /planner portion of the URL to the Ruby
> application, which I don't want because I don't have a route in my web
> application that matches /planner. Essentially, I'd like
> bryan.example.com/planner to become the root URL for my Ruby
> application, such that navigating to bryan.example.com/planner/admin
> would just pass the /admin portion of the URL to the Ruby application,
> but I'm not sure how to do that. I'm assuming it has something to do
> with some of the other proxy options available...

You instructed nginx to pass url as is and it does so. If you want
"/planner" portion to be stripped/replaced by something you have
to use proxy_pass with uri component, i.e. ...

> location /planner/ {
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header Host $http_host;
> proxy_redirect off;
>
> proxy_pass http://planner;

- proxy_pass http://planner;
+ proxy_pass http://planner/;

Note trailing "/".

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help With Locations and Proxying

Bryan Richardson June 21, 2010 02:44PM

Re: Help With Locations and Proxying

Maxim Dounin June 21, 2010 03:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready