Comments (17)
Dragonfly works only with one domain out of box. I think we have to find out how to configure that
from dragonfly.
Ok, thanks for confirming this. I wanted to make sure that I was not missing some configuration parameter or something. This feature is really important for me. I am working on a website that is expected to get a bunch of traffic. I trying to figure out how to speed up the user experience. Multiple asset hosts being supported is a must!
BTW: Thanks Mark for all your work on this project. Dragonfly has become my standard tool that I use in just about all my projects involving user contributed images. You have saved me so much time!
from dragonfly.
as asset server you can use Amazon s3. Dragonfly supports that.
from dragonfly.
Dragonfly serves up media from its own Rack server by default - not directly from S3 (though you could hand-craft urls yourself if you wanted to)
In the future it might be nice to have something like a configurable 'remote_url'.
However, dragonfly doesn't particularly know about which domain it's on, so I don't know why that wouldn't be working. I'll try and have a go doing that myself when I get the chance and figure out what's wrong.
from dragonfly.
Yes, it looks like passenger issue. If you'll find some new information about that, please, let us know.
Thank you!
from dragonfly.
If you would like more information about my setup:
Passenger 3 on Nginx, Ruby 1.9.2, Rails 3, Dragonfly 0.7.6
One more thing that is related: All four asset host subdomains are aliases to the same application. I can point my webrowser to media0.mydomain.com and see my app. Everything works except the images served by dragonfly. This is also true if I turn off asset hosts. The images will only show if they are served from my original domain. They will not work from any other aliased subdomain. When the images are resized, does dragonfly somehow use the domain when generating the image url hash?
from dragonfly.
Same issue here. Passenger 3 on Nginx, Ruby 1.9.2, Padrino.rb, Dragonfly 0.7.6.
It took us some hours to figure it out, because we had multiple domains pointing to the same Application. (Our production domain and an internal one for testing). This is a very critical issue.
from dragonfly.
My solution was to redirect all requests to "main" domain: http://goo.gl/OZ4k8
from dragonfly.
Same error here....
from dragonfly.
what kind of? it works for me
from dragonfly.
@sergio-fry
With redirection it works, but the URL in the browser is changed to the original website, and I don't want this behavior in my app.
from dragonfly.
@fabiotc Yes, I agree. The redirection is a hack but not a solution. The point of having the separate asset host domains is to allow simultaneous image downloading, and to load balance. It is my understanding that most browsers will not allow multiple simultaneous connections to the same host. But will to multiple hosts.
Still no solution to this? I am sorry that I do not have the time to investigate it further at this point. Is this only related to passenger? Or does it happen in other environments?
from dragonfly.
Ok, I have found the solution to this. Apparently it is an Nginx + Passenger issue. I have no clue why, or how. But by adding the following line to my routes.rb I am able to use distributed asset hosts, and also use passenger standalone in development:
match '/media/*dragonfly', :to => Dragonfly[:images]
from dragonfly.
Great, @demersus! is it possible to write patch for dragonfly?
from dragonfly.
We will have to spend some time tracking the exact problem. I am determined to to find it, if someone else does not. I just don't have any extra time at this point.
When I stumble across the offending code I will contribute a patch. It definitely seems to be a passenger + nginx issue. The only reason why I found the above fix is because I started using passenger standalone in development, and could not get the images to work. I found the above fix in a forum, I believe it was the google group for dragonfly, to fix the standalone version of passenger. So I decided to leave it in my routes.rb file and it fixed the problems in production as well.
I hope this solves it for you guys too. @sergio-fry, @fabiotc, and @maxschulze.
I must say it is a nice speed boost to have four hosts working on image resizing at the same time!
from dragonfly.
Also, something I wanted to share for you if you are going to make a lightbox, or link to the images. You will have to use 'compute_public_path' to force the path for the link to use the distributed asset hosts. Example:
<%= link_to image_tag(@my_model.image.thumb('50x50').url), compute_public_path(@my_model.image.thumb('800x600>').url, "") %>
This will generate a full url using your asset hosts for the linked image.
from dragonfly.
@demersus You are awesome! :) I'll try it out soon
from dragonfly.
Related Issues (20)
- Default content auto-whitelist doesn't work with FileDataStore
- Can't store resized pdf as jpg HOT 5
- Requesting filename without download file for custom stores HOT 2
- Turning Off Logs HOT 1
- Dragonfly unit test cases failing in Rails 4 HOT 1
- Dragonfly::FileDataStore::UnableToFormUrl: you need to configure server_root for Dragonfly::FileDataStore in order to form urls
- How to ignore "Dragonfly::FileDataStore destroy error"?
- Adding the ability to specify headers for a URL based attachment HOT 3
- Fetching url in the background
- after_assign's copy_to doesn't fire when using retained_image HOT 1
- SSL verification mode option
- warning: loading in progress, circular require considered harmful HOT 1
- is this version of Dragonfly compatible ? HOT 4
- Support for posix-spawn? HOT 2
- Security Issue Report HOT 1
- Guidance on upgrading to 1.4.0 HOT 7
- validate problems?
- CSS style color raising InvalidParameter when using plain generator HOT 1
- Questions about GHSA-qrgf-jqqm-x7xv HOT 2
- Allowing quality and interlace params for imagemagick thumb processor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dragonfly.