https proxy to apache server

Jelle de Jong jelledejong at
Tue Jan 10 11:21:15 UTC 2012

I got an namebased vhost apache server running on for 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;
    ssl         on;
    ssl_certificate      /etc/ssl/certs/yessica-certificate.pem;
    ssl_certificate_key  /etc/ssl/certs/yessica-privatekey.pem;
    access_log  /var/log/nginx/;
    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;
} is giving me SSL received a record that
exceeded the maximum permissible length. (Error code:

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)

Thanks in advance,

Kind regards,

Jelle de Jong

More information about the nginx mailing list