Welcome! Log In Create A New Profile

Advanced

Re: proxy, upstream, apache vhosts not working

Isaac Hailperin
July 27, 2012 04:46AM
On 07/26/2012 05:42 PM, Valentin V. Bartenev wrote:
> On Thursday 26 July 2012 18:48:45 Isaac Hailperin wrote:
>> Hi,
>>
>> I want to configure nginx as a proxy to a bunch of apaches, all serving
>> the same multiple websites via vhosts.
>>
>> I had it working with something like
>> location ~* \.(jpg|gif|png|css|js) {
>> try_files $uri @proxy;
>> }
>> location @proxy {
>> proxy_pass http://www.acme.net;
>> }
>> location / {
>> proxy_pass http://www.acme.net;
>> }
>>
>> in my server section.
>> But this only asked a single apache, the one configured in /etc/hosts
>> for http://www.acme.net.
>>
>> Now I am trying to use all of my apaches. I defined an upstream block
>> like this:
>> upstream backend-all-apaches {
>> server 10.10.1.25;
>> server 10.10.1.26;
>> server 10.10.1.27;
>> server 10.10.1.28;
>> server 10.10.1.15;
>> server 10.10.1.18;
>> server 10.10.1.20;
>> }
>> proxy_set_header Host $host;
>>
>> And the following in my server block:
>> location @proxy {
>> proxy_pass http://backend-all-apaches;
>> }
>> All I get in my browser is a default page that also gets deliverd when I
>> call http://10.10.1.25 in my browser. So I assume the apaches don't get
>> the right host value in the http header. I thought that
>> proxy_set_header Host $host;
>> would solve this problem, but apprently it does not.
>>
>> What am I doing wrong here, or what else could I try?
>>
>
> Is the above configuration is exactly what you're actually use?
Almost. I changed IPs and servername, the rest is the same.

Isaac

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy, upstream, apache vhosts not working

Isaac Hailperin July 26, 2012 10:50AM

Re: proxy, upstream, apache vhosts not working

Valentin V. Bartenev July 26, 2012 11:44AM

Re: proxy, upstream, apache vhosts not working

Isaac Hailperin July 27, 2012 04:46AM

Re: proxy, upstream, apache vhosts not working

Isaac Hailperin July 27, 2012 05:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready