rack ssl and nginx configuration
Hi I am trying to use rack ssl with my nginx. Everything works fine on all pages apart from my statics dragonfly images which is serve as a proxy via nginx. Here is that part of the config (ofc when in non ssl mode all images serves just fine). Any idea how to solve this?:
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;
}
}
EDIT ------
Ok I got abit further. I found a section of my nginx conf that had this:
server {
listen unix:/tmp/nginx-production.sock;
root /home/rails/production/current/public;
passenger_enabled on;
rails_env staging;
}
ofc you see rails_env was wrong so i changed it to production and all images returns fine if it was not populated via a ajax request.. so the hunt goes on :(
EDIT ------ found this also. All image that does no开发者_运维百科t render under ssl have a URL of: https:///media/ chrome shows a 502
but ones that does redner have: https:///media/?
Am starting to this is somthing with the way dragonfly is used? Then why is it ok for some and not other...
精彩评论