Imageprocessor: Accessing images with remote.axd from subdomain

Created on 6 Jul 2016  路  32Comments  路  Source: JimBobSquarePants/ImageProcessor

Hi guys,

I have an issue where I getting images from another place, using the remote.axd.

From the staging url (http://www.staging.com/remote.axd?http://www.remax-malta.com/UserImages/24/large/L_878263c333524b61bb336ed6eba363a2_iList.jpg?anchor=center&mode=crop&width=1358&height=800&rnd=131081472090000000?entropycrop=250&width=1358&height=800&mode=crop) WORKING FINE.

Now, we have gone live and the url was changed to http://mysite.remax-malta.com.

Now, for every image, it is saying not found (http://mysite.remax-malta.com/remote.axd?http://www.remax-malta.com/UserImages/24/large/L_878263c333524b61bb336ed6eba363a2_iList.jpg?anchor=center&mode=crop&width=1358&height=800&rnd=131081472090000000?entropycrop=250&width=1358&height=800&mode=crop))

Any idea how I can configure such configs to make it work?

thank . appreciate.

Kind Regards

bug fixed on dev framework

Most helpful comment

FANTASTIC NEWS!!! :tada:

Very glad you found the solution.

All 32 comments

Im afraid t doesn't work in subdomains... Yet... Waiting on a PR

See #415 and #410

Hi JImBob,

thanks for you reply.
Not the remote.axd, but the general image processor is not working.

Are there any solution?

Hi JimBob,

It is strange because the www is also a subdomain.

So how come http://www.staging.com is working and http://www.mysite.remax-malta.com is not working?

Thanks

It's all in the number of periods in the url. The HttpModule wasn't correctly mapping the application path.

I've just pushed a fix testing against both

  • .imageprocessor.foo.bar.baz.com
  • www.imageprocessor.foo.bar.baz.com

and it now works perfectly.

I'll get a release out soon.

How can I update it, please?

Acutally, my url is mysite.remax-malta.com

@simoazzo It shouldnt really matter what the url is now. ImageProcessor.Web will read it correctly.

To answer your other question I need to perform a full set of tests before I release the new version. I'll try and run those tests this evening.

New release available on Nuget now.

Hi JimBob,

I have updated the imageProcessor but no success.

I am trying to access the image wth the following url:

http://commercial.remax-malta.com/remote.axd?http://www.remax-malta.com/UserImages/24/L_3a19d3a0a996448aa2c7f8979ec43d2a_iList.jpg?entropycrop=250&width=1358&height=800&mode=crop

Have you?

I just checked the response headers and your version numbers are the following.

ImageProcessor/2.4.0.0 - ImageProcessor.Web/4.6.0.0

The version numbers should be.

ImageProcessor/2.4.3.0 - ImageProcessor.Web/4.6.3.0

I would perform a clean, rebuild, and try again.

I'm quite sure that I have updated them both, through nuGet.

And replaced both .dll files and web.config...

Before I checked your response headers? Those numbers are coming from the version numbers in your application.

Yes. The .dll and the web.config are need to be changed right, after update? and how can I check that from the response headers? Through dev tools?

Hi JimBob,

I have tried it on another website but it is not working. I updated both ImageProcessor and ImageProcessor.Web but it is not working.

the site is: http://auctions.remax-malta.com/

Hi JimBob,

How about the fix regarding the url? In my case, through this url (auctions.remax-malta.com) the imageprocessor is not working.

thank you. Hearing from you

Hi there, my apologies, but I'm super swamped. Have you trued downloading the source and debugging?

Hi JimBob,

Yes, I have checked the code and the issue is because of the url, having two subdomains... because I have www and in my case (auctions.remax-malta.com) I have also the auctions as another subdomain.

I don't know if you can arrange that accordingly to work even with two sub domains, because www is a sub-domain.

Thanks

kind regards

Thanks for checking.

I'll need a lot more detail though Would it be possible for you to tell me where the exception is thrown?

Your url is incorrect. You're using the old double ? and the schema when you shouldn't be. See the documentation.

http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/#remote

I just added bindings to match your url on my local machine and tested the four following combinations.

http://www.commercial.remax-malta.com/remote.axd/www.remax-malta.com/UserImages/24/L_3a19d3a0a996448aa2c7f8979ec43d2a_iList.jpg?entropycrop=250&width=1358&height=800&mode=crop

http://www.commercial.remax-malta.com/remote.axd/remax-malta.com/UserImages/24/L_3a19d3a0a996448aa2c7f8979ec43d2a_iList.jpg?entropycrop=250&width=1358&height=800&mode=crop

http://commercial.remax-malta.com/remote.axd/www.remax-malta.com/UserImages/24/L_3a19d3a0a996448aa2c7f8979ec43d2a_iList.jpg?entropycrop=250&width=1358&height=800&mode=crop

http://commercial.remax-malta.com/remote.axd/remax-malta.com/UserImages/24/L_3a19d3a0a996448aa2c7f8979ec43d2a_iList.jpg?entropycrop=250&width=1358&height=800&mode=crop

Each of them worked perfectly. The only configuration I had to do was in security.config where I added the value.

<add url="http://remax-malta.com/"/>

Here's a picture of proof.

ip

Hi JimBob,

I don't think so that that's the problem, of the remote.axd.. because in auctions.remax-malta.com I do not have remotely images...

And I have tried again, online.. and it does not work.. the last two

I'm using exactly the same url that you provided me with the fixes and it works.

Give me an exact url to query and I'll see what I can determine. You've not provided anywhere near enough information so far.

Hi JimBob,

Ok, let me take this example. For the following site, I have updated the Image Processor to the latest:

URL 1 (not working): http://auctions.remax-malta.com/media/1149/a001l05-1-main.jpg?anchor=center&mode=crop&overlay=wm.png&overlay.opacity=80

URL 2 (working): http://www.remaxauctions.jkgroup.casasoft-dev.com//media/1149/a001l05-1-main.jpg?anchor=center&mode=crop&overlay=wm.png&overlay.opacity=80

Both domains binds to the same file system. One is working and the other is not working.

That's what I am referring to that the image processor is changing behavior on domain url.

Take a look and let me know. Thank you JIM

Right... So you mean the overlay processor is not working on the first url?

That's an entirely different issue.

It's really important when you are raising issues to ensure that you provide all the necessary information in order for me to correctly debug and provide a solution. There are contributions guidelines that I have added to the solution in order to make the process easier for everyone involved.

https://github.com/JimBobSquarePants/ImageProcessor/blob/Core/contributing.md

That said, now I know what I am looking for I should be able to provide you with a solution.

Update

So I've been investigating your response headers on http://auctions.remax-malta.com and no image requests are being intercepted by ImageProcessor.Web

I've mapped my local test website to the http://auctions.remax-malta.com url in IIS and and in my hosts file. That now matches your url with the exact same subdomain.

ip

127.0.0.1 auctions.remax-malta.com
127.0.0.1 www.auctions.remax-malta.com

In my processing.config I have the overlay plugin enabled with the default settings.

<plugin name="Overlay" type="ImageProcessor.Web.Processors.Overlay, ImageProcessor.Web" enabled="true">
    <settings>
        <setting key="VirtualPath" value="~/images/imageprocessor/overlay/"/>
    </settings>
</plugin>

And everything works as expected.

ip

I think the best things for you to do now is to check all your environments to ensure that you have everything setup in the same manner across all your platforms and projects.

I am using exactly the same code as the latest releases ImageProcessor v2.4.3, ImageProcessor.Web 4.6.3 in my test website so as far as I can tell there must be an issue with your setup.

Hi Jimbob,

the above were just an examples with the overlay, you can also try the width and height etc...

May I ask what could be the issue with the server and what type of settings might I am missing in order that they are not working using such urls?

There's something with the server but I don't know exactly. Maybe you can help me out on this after we identified the problem?

This is gonna be tough... I'd start with your web.config and ensure the httpmodules are correctly configured.

The web.config is the same for both, for the one working and for the one that it is not working... the only difference is the url...

http://auctions.remax-malta.hector.casasoft-dev.com (working)
http://auctions-remax-malta.com (not working)

Well I think we've established already that the domain name has nothing to do with it. There must be another difference. OS version, IIS version, Modules within IIS, .NET framework version, external libraries, the list goes on...

This isn't a code issue and I don't have access your servers so I'm afraid I can't be of any help to you.

Hi JimBob,

After get deeply into the issue that we had, after investigation we have found what was causing the problem.

First we tried to match the response headers to see what's difference by the url that it was working and the other that it wasn't. Then we found that the one that was not working was being served by cloudflare.

After determined that Cloudlfare was the problem we then continued to investigate on what was causing the problem from Cloudlfar and then we realized that the Caching of the Cloudflare was set to No Query String. Therefore, that' why it was not working because Cloudflare was acutally caching without query strings, where actually for the image processor to work are necessary. We're still thinking why the caching was set to No Query String. Acutally the client we are working for has somewhat change to No Query String. Then we changed it to Standard

Hopefully, we solved the question. We have posted this comment as a SOLUTION for thosse who might face the same problem.

Don't forget, if you are using image processor and CLoudflare, make sure that the Cloudflare caching setting is set to Standard

FANTASTIC NEWS!!! :tada:

Very glad you found the solution.

Was this page helpful?
0 / 5 - 0 ratings