Welcome! Log In Create A New Profile

Advanced

Re: multiple https proxy_pass to diffrent apache server

Valentin V. Bartenev
January 14, 2012 11:34AM
On Saturday 14 January 2012 19:17:37 Jelle de Jong wrote:
> Hello everybody,
>
> The relevant part of the config: http://paste.debian.net/hidden/9d3d8f16/
>
> I want to proxy pass port 443 based on the server_name to different
> Apache servers, anybody knows how should I do this?
>
> Summary of the config: (see the above pastebin for more info)
>
> server {
> listen 443;
> server_name calendar.powercraft.nl;
> ssl on;
> ssl_certificate /etc/ssl/certs/certificate.pem;
> ssl_certificate_key /etc/ssl/certs/privatekey.pem;
> keepalive_timeout 70;
> location / {
> proxy_redirect off;
> proxy_pass https://192.168.24.66/;
> }
> }
>
> server {
> listen 443;
> server_name webmail.tuxblogger.nl;
> ssl on;
> ssl_certificate /etc/ssl/certs/certificate.pem;
> ssl_certificate_key /etc/ssl/certs/privatekey.pem;
> location / {
> proxy_redirect off;
> proxy_pass https://192.168.24.67/;
> }
> }
>
> I want to add several more server_names if possible.
>

Probably something like this would work:

map $host $backend {
calendar.powercraft.nl 192.168.24.66;
webmail.tuxblogger.nl 192.168.24.67;
}

server {
listen 443;
server_name calendar.powercraft.nl webmail.tuxblogger.nl;

ssl on;
ssl_certificate /etc/ssl/certs/certificate.pem;
ssl_certificate_key /etc/ssl/certs/privatekey.pem;

keepalive_timeout 70;

location / {
proxy_pass https://$backend/;
}
}


wbr, Valentin V. Bartenev


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

multiple https proxy_pass to diffrent apache server

Jelle de Jong January 14, 2012 10:18AM

Re: multiple https proxy_pass to diffrent apache server

Valentin V. Bartenev January 14, 2012 11:34AM

Re: multiple https proxy_pass to diffrent apache server

Valentin V. Bartenev January 14, 2012 11:42AM

Re: multiple https proxy_pass to diffrent apache server

Valentin V. Bartenev January 14, 2012 01:00PM

Re: multiple https proxy_pass to diffrent apache server

Maxim Dounin January 14, 2012 06:28PM

Re: multiple https proxy_pass to diffrent apache server

Gena Makhomed January 14, 2012 11:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
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