mercredi 22 avril 2015

serve ssl webpage via nginx, ssl_error_rx_record_too_long

Please help me: there is something wrong in this virtual.conf nginx conf file that means that when viewing the site, I get the error ssl_error_rx_record_too_long rather than being able to view my site. I am using aws, nginx to serve some rails apps - this was working yesterday, but I crashed my entire server and am frantically trying to fix this at 2am, ready for production at 9:30am.

ssl_certificate     /etc/ssl/star_my_site.pem;
ssl_certificate_key         /etc/ssl/star_my_site.key;


# ------------------
# rails app one
# ------------------

upstream my_app {
  server unix:///var/run/puma/my_app.sock;
}

server {
  listen      80;
#  server_name rails_app_one.my_site.com.au http://ift.tt/1aSvYaz;
  server_name _ localhost;
  return      301 http://ift.tt/1Jc9r7J;
}

server {
  listen   443;
  server_name _ localhost;

  location / {
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto https;
     proxy_set_header Host $http_host;
     proxy_redirect off;
     proxy_pass http://my_app;
  }

  location ~ "^/assets/" {
    root /var/app/current/public;
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }
}

# ------------------
# rails app two
# ------------------

upstream rails_app_two_app {
  server unix:///var/run/puma/rails_app_two_app.sock;
}

server {
  listen      80;
  server_name rails_app_two.my_site.com.au http://ift.tt/1Jc9r7N;
  return      301 http://ift.tt/1aSw0PM;
}

server {
  listen   443;
  server_name  rails_app_two.my_site.com.au;

  location / {
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto https;
     proxy_set_header Host $http_host;
     proxy_redirect off;
     proxy_pass http://rails_app_two_app;
  }

  location ~ "^/assets/" {
    root /var/app/rails_app_two.my_site.http://ift.tt/1aSw0PO;
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }
}




Aucun commentaire:

Enregistrer un commentaire