Reverse proxy for multiple domains

Francis Daly francis at daoine.org
Wed Aug 30 17:57:19 UTC 2017


On Sun, Aug 27, 2017 at 11:27:05AM +0000, Mik J via nginx wrote:

Hi there,

> > Thats because the pages are called by the reverse proxy server
> > like http://10.1.1.10:80/app/application1/;and it can't use a FQDN
> > because it's in a private adressing
> Francis: I don't follow that last part.=> I mean that the reverse proxy uses an IP to connect to the backend web server. If it used a fqdn, it has to resolve it, through a dns request

The backend web server can care about the IP:port you connect to, and
the Host: header you send.

You can connect to 10.1.1.10:80 and send a Host: header of "app1" if
you want to. No dns resolution involved.

Anyway, it sounds like you have this part working now; so that's good.


> I still have problems, the site doesn't diplay properly because it can't load a javascript

> The request for the javascript looks like thathttp://application1.org/?wooslider-javascript=load&t=1503832510&ver=1.0.0 HTTP/1.1It arrives on the backend server I see it in the logs (file specified in the stanza location)
> 10.1.1.10 forwarded for IP_CLIENT - - [27/Aug/2017:13:15:12 +0200] "GET /app1/?wooslider-javascript=load&t=1503832510&ver=1.0.0 HTTP/1.1" 404 5 "http://application1.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0"

A request for /?some-thing came to nginx; nginx reverse-proxied the request
as /app1/?same-thing. That is all you want nginx to do, so it is working.

If your back-end wordpress handles that request incorrectly, that is a
question for your back-end wordpress configuration.

People on this list who know about wordpress configuration are more
likely to see the question if it is in a new thread with words like
"wordpress" in the Subject: line.

(If the actual question is "why does my browser request /?some-thing
instead of /thing.js ?", that might also be related to the back-end
config.)

> Another question, if I want to set expires header, would it be better to do it on the reverse proxy or on the backend server ?

Again, I'd suggest that people who know about "wordpress" and "expires"
are much more likely to see that question if it is in a thread with an
obvious Subject: line.

Good luck with it!

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list