https proxy to apache server

Maxim Dounin mdounin at mdounin.ru
Tue Jan 10 14:38:50 UTC 2012


Hello!

On Tue, Jan 10, 2012 at 12:21:15PM +0100, Jelle de Jong wrote:

> I got an namebased vhost apache server running on 192.168.24.66 for
> calendar.powercraft.nl on both port 80 and 443.
> 
> I need nginx to make a proxy pass for port 443 to the apache server. I
> don't mind if it uses the port 80 or 443 with ssl to proxy the data.
> 
> I tried the bellow and some variations based on some docs. and wiki
> pages I found, but I cant get it to work for port 443
> 
> server {
>     listen      443;
>     server_name calendar.powercraft.nl;
>     ssl         on;
>     ssl_certificate      /etc/ssl/certs/yessica-certificate.pem;
>     ssl_certificate_key  /etc/ssl/certs/yessica-privatekey.pem;
>     access_log  /var/log/nginx/calendar.secure.log;
>     error_log   /var/log/nginx/calendar.error-secure.log;
>     location / {
>         #proxy_set_header   Host $host;
>         proxy_set_header    X-Real-IP $remote_addr;
>         proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
>         proxy_redirect      off;
>         proxy_pass          http://192.168.24.66/;

Just use "https" instead of "http" here, i.e.

          proxy_pass          https://192.168.24.66/;

>     }
> }
> 
> https://calendar.powercraft.nl/ is giving me SSL received a record that
> exceeded the maximum permissible length. (Error code:
> ssl_error_rx_record_too_long)
> 
> Does somebody know what I am doing wrong and may provide a working
> example to make a https proxy with nginx to an apache server?
> 
> I tried searching the mailing-list archive for the last year but didn't
> find a similar question. (my apologies if I missed something)

Maxim Dounin



More information about the nginx mailing list