Welcome! Log In Create A New Profile

Advanced

Re: proxy_pass bug

Maxim Dounin
November 14, 2009 11:58AM
Hello!

On Sat, Nov 14, 2009 at 10:16:36AM -0500, supeng wrote:

> I have a tomcat server bind localhost:8080, and my nginx 0.8.24's conf is
> ======================================
> ... ...
>
> server {
> listen 80;
> server_name localhost;
>
> location / {
> proxy_pass http://localhost:8080;
> }
> }
> ... ...
> ======================================
> when I access http://mydomain/docs, the url will be redirected to http://localhost/docs. Of course, the url, http://mydomain/docs/ , is working correctly!

http://wiki.nginx.org/NginxHttpProxyModule#proxy_redirect
http://wiki.nginx.org/NginxHttpCoreModule#server_name_in_redirect

In your case proxy_redirect default should be ok as long as you
set correct server_name, i.e.

server_name mydomain;

or use

server_name_in_redirect off;

Maxim Dounin
Subject Author Posted

proxy_pass bug

supeng November 14, 2009 10:16AM

Re: proxy_pass bug

supeng November 14, 2009 10:25AM

Re: proxy_pass bug

Maxim Dounin November 14, 2009 11:58AM

Re: proxy_pass bug

supeng November 14, 2009 09:47PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready