URL Redirect Problems

Francis Daly francis at daoine.org
Fri Nov 12 19:15:46 MSK 2010


On Fri, Nov 12, 2010 at 10:30:05AM -0500, fwKilo wrote:

Hi there,

> It does the same thing as what I have. I've tried using proxy_pass, but
> all it does is load up text and none of the images work.

As a reminder, that was:

        location /tango {
	        rewrite ^ http://vbox.bravo.mysites.com permanent;
        }

If you want not to change the url in the browser bar, you must not issue
a redirect (= an external rewrite).

Since the content is on a different server, you cannot just use an
internal rewrite -- you must use proxy_pass.

If you control the http://vbox.bravo.mysites.com server, you will
find it much easier if you can configure it to serve from the "/tango"
url space (as in, http://vbox.bravo.mysites.com/ is empty apart from
http://vbox.bravo.mysites.com/tango/, which then has all the content
below there) -- otherwise, you will have to ensure that all links within
the content are changed to include "/tango" as necessary, yourself.

(That's presumably why the "none of the images work" -- the browser
requests /tango/file.html, which refers to /image.png; the browser then
requests /image.png, which your proxying server does not proxy because
it does not start with /tango.)

See the Fine Manual (on the wiki) for some other configuration directives
that should help with the header rewriting, if necessary.

All the best,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list