Rewrite or proxy_pass to internal ip ?

Francis Daly francis at daoine.org
Tue Oct 30 19:48:49 UTC 2012


On Tue, Oct 30, 2012 at 07:33:14AM -0400, hristoc wrote:

Hi there,

> I get real html from internal server with curl and is exact what I expect.

So: when you do "curl -0 -i http://192.168.1.1/" from the nginx server,
you get the same content as when you do "curl -i http://public-ip/admin"
from somewhere on the internet?

That suggests that the proxy_pass is working.

> For example if I try to access direct js file over the
> web like: http://www.mydomain1.com/server1/js/jsquery.js I get error 404
> file not found. I think nginx does not forward this request to internal
> serve and trying to find the js file on local directory.
> 
> How to resolve this issue ?

What is your nginx configuration?

In particular: what "location" blocks do you have?

http://nginx.org/r/location for details. My guess is that you have
something like "location ~ js" as well as "location /admin", and nginx
chooses that location block for this request.

If that is true, then possibly using "^~" will work for you.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list