Proxy not listening to 443


We are running some applications servers (grails) and using nginx as
proxy before that for caching and load balancing purposes.

everything is working as expected, but now that we received our ssl
certificate, i am failing to route the ssl requests over nginx (i did
understand that i could tell nginx the certificate and then serve the
content of the http only servers in backend via ssl “frontend”).

here is my server block:

upstream foobar {

server {
        listen 443 default_server ssl;
        listen 80;

        access_log /.zis/logs/access.log;

        ssl_certificate /.zis/cert/foobar_lu.crt;
        ssl_certificate_key /.zis/cert/foobar.key;

        ssl_protocols SSLv3 TLSv1;

        location ~* ^/(login|admin|account).*$ {

           if ($scheme = "http") {
              rewrite ^$request_uri permanent;

           proxy_pass             http://foobar;
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For 

           proxy_set_header     X-Forwarded-Proto $scheme;
           add_header              Front-End-Https   on;
           proxy_redirect          off;
[.. non-ssl caching stuff..]

accessing the page via httpsyields to ERR_CONNECTION_REFUSED and nestat
offers me no-one listening on 443:

[email protected]:/home/jeremy# netstat -nl | grep :4
tcp 0 0*

tcp 0 0*

[email protected]:/home/jeremy# netstat -nl | grep :80
tcp 0 0*

tcp 0 0*

Is there something special about ssl i did not configure right maybe? I
tried splitting 80 and 443 in separate server blocks but no luck so far.

Any help would be highly appreciated, thanks in advance, Andreas

Posted at Nginx Forum:,237547,237547#msg-237547


Its getting better :slight_smile:

Could get it to listen to 443 by using

listen *:443 default_server ssl;
listen *:80;

(star double dot port)

however server still says


and in access log, nothing appears for https … any help would be highly
appreciated …

Posted at Nginx Forum:,237547,237566#msg-237566

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs