1

こんにちは、nginx でラック SSL を使用しようとしています。nginx経由でプロキシとして機能する静的トンボ画像を除いて、すべてのページですべて正常に動作します。これが設定の一部です(非sslモードでは、すべての画像が正常に機能します)。これを解決する方法はありますか?:

server {
    listen 0.0.0.0:443;
    server_name server.com;
    root /home/rails/production/current/public;
    passenger_enabled on;
    rails_env production;


    ssl on;
    ssl_certificate some.crt;
    ssl_certificate_key some.key;

    location /home {
       rewrite ^ https://www.example.com/ permanent;
    }


    location /media {
       try_files $uri @media;
    }

    location @media {
       proxy_redirect         off;

       proxy_pass http://unix:/tmp/nginx-production.sock;
       proxy_store /home/rails/production/current/public$uri;
       proxy_store_access user:rw group:rw all:r;
     }


}

編集 - - -

わかりました、さらに少し進みました。これを含むnginx confのセクションを見つけました:

server {
   listen unix:/tmp/nginx-production.sock;
   root /home/rails/production/current/public;
   passenger_enabled on;
   rails_env staging;
 }

ofc rails_env が間違っていたことがわかるので、本番環境に変更し、ajax リクエストを介して入力されていない場合はすべての画像が正常に返されます..だから、狩りは続きます :(

編集 ------ これも見つかりました。SSL でレンダリングされないすべての画像の URL は次のとおりです: https:///media/ chrome は 502 を示します

しかし、レッドナーを持っているもの: https:///media/?

これは、トンボの使用方法に問題があるのでしょうか? では、なぜ一部の人は大丈夫で、他の人は大丈夫なのですか...

4

0 に答える 0