nginx and tomcat integrated but how to serve static files

Irfan Khan irfan.khan at
Tue Dec 11 08:48:27 UTC 2012


My config is same as earlier. I had tried to access /foo/learning.html from
Nginx. But if I keep tomcat server off then I am unable to load this page.
If I keep tomcat server up and try for some files (blah.html)which is not
exists then tomcat reports an error on page.  

I have also tried giving full access to webapps directive just for testing
purpose. Nothing worked!

Kindly suggest, my config is as follows;

Location /foo/*
Root /tomcat/webapps/abc/

> location /abc/ {

proxy_pass http://localhost:8080;
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;

Thanks and Regards,
Irfan Khan

-----Original Message-----
From: nginx-bounces at [mailto:nginx-bounces at] On Behalf Of
Francis Daly
Sent: 11 December 2012 01:19
To: nginx at
Subject: Re: nginx and tomcat integrated but how to serve static files

On Mon, Dec 10, 2012 at 09:55:01PM +0530, Irfan Khan wrote:

Hi there,

> Thanks for the suggestion, but unfortunately it didn't worked.

What one url did you try that you wanted to be served from the filesystem,
but was instead served by tomcat? (And why do you think that it was served
by tomcat?)

What config file do you use that shows the problem?

Francis Daly        francis at

nginx mailing list
nginx at

More information about the nginx mailing list