Nginx and Tomcat 6 proxy pass

Posted by Patrick Schneider on Server Fault See other posts from Server Fault or by Patrick Schneider
Published on 2012-12-13T10:21:48Z Indexed on 2012/12/13 11:06 UTC
Read the original article Hit count: 310

Filed under:
|

i've got problems tp configure nginx as reverse proxy for an tomcat application.

I want to set domain www.example.com/blog to pass to an tomcat application.

nginx-site:

server {
    listen 80;
    servername example.com;

    location /blog {
       proxy_pass http://localhost:8080/blog;
       proxy_redirect off;
    }
}

Now when i call on my browser http://example.com/blog it redirects to localhost/blog which does not work.

curl http://localhost:8080/blog -H "host: example.com/blog" -v shows a 302 to localhost/blog

Any ideas?

© Server Fault or respective owner

Related posts about nginx

Related posts about tomcat