2016-10-26 2 views
2

とRailsのアプリのルビーのSSLは私のnginxののconfファイルで有効にする:証明書へここでnginxのとプーマ

upstream app { 
    server unix:/home/deploy/example_app/shared/tmp/sockets/puma.sock fail_timeout=0; 
} 

server { 

    listen 80; 
    listen 443 ssl; 
    # ssl on; 
    server_name localhost example.com www.example.com; 

    root /home/deploy/example_app/current/public; 

    ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem; 
    ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem; 

    try_files $uri/index.html $uri @app; 

    location/{ 
    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header Host $host; 
    proxy_redirect off; 
    proxy_http_version 1.1; 
    proxy_set_header Connection ''; 
    proxy_pass http://app; 
    } 

    location /.well-known { allow all; } 

    location ~ ^/(assets|fonts|system)/|favicon.ico|robots.txt { 
    gzip_static on; 
    expires max; 
    add_header Cache-Control public; 
    } 

    error_page 500 502 503 504 /500.html; 
    client_max_body_size 4G; 
    keepalive_timeout 10; 
} 

パスが正しいですが、私はhttps://example.comにアクセスするとき、それは永遠に読み込みに滞在。

SSLの設定に問題はありますか?

+0

なぜsslはコメントアウトされていますか? –

+0

コメントを外すと400エラーが表示されます。単純なHTTP要求がHTTPSポートに送信されました。 –

+0

私がNginxのドキュメントで読んでいるので:http://nginx.org/en/docs/http/configuring_https_servers.htmlこれは必要ありません。 @ j-dexx –

答えて

2

SSL checkerを試して、SSLが問題であるかどうかを確認してください。

サーバー証明書を確認し、問題の原因を教えてくれます。

関連する問題