![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Device: Kindle
|
Content server, IIS proxy, and gzip compression
Hello-
I'm trying to publish the content server using a proxy set up on my IIS server. I'm using URL Rewrite, which rewrites the public URL to a private one where the content server is running. On the way back out, it changes the private URL back to the public one, and forwards the traffic. Or, that's what it should do, anyway. When IIS tries to rewrite the URL, I get the error: HTTP Error 500.52 - URL Rewrite Module Error. Outbound rewrite rules cannot be applied when the content of the HTTP response is encoded ("gzip"). Looks like IIS is not capable of rewriting if the data is compressed. Is there any way to turn off the gzip compression on the content server? Thanks in advance, Adrian |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can run it from source, its a simple change in the source code. Although I find it odd that URL rewriting should depend on content encoding.
Just change line 373 in library/server.py to False |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Device: Kindle
|
Thank you for the quick reply. I see where to change the server.py file, but how do I then run it from source?
Would you consider putting in a selector for this in the UI in a future release? |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Running calibre from source is trivial, instructions are in the user manual. First see if this actually fixes your problem.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Device: Kindle
|
Ah, ok. Got the instructions and got the source running. I didn't see that before.
I made the change, and it actually doesn't seem to turn gzip off. I tried setting it to False, and tried removing the mime types as well, but the content still comes across gziped. Adrian |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Are you sure the server is running the development code? run it as
calibre-server --develop and stick a few print statements in to make sure |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Device: Kindle
|
Yes, seems to be. I was running the app, then launching the server from the preferences. I changed False to Falsexxx and got an error. Running as you noted above, I can see the the get request coming from my proxy box as well.
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm in that case, I have no idea why the server would still keep gzip compression. I don't have the time to dive into the ocs right now, but if you do, the server uses cherrypy
|
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Device: Kindle
|
I've been messing around with this off and on, and finally got it working! Here's what I found out.
In addition to the gzip in cherry.py, IIS was also compressing. Which is interesting, since the proxy was not compatible with it's own compression. I turned that off, and could hit the Calibre web interface. Actually getting the IIS proxy to work correctly was tricky. I used this tutorial: http://learn.iis.net/page.aspx/659/r...quest-routing/ I additionally had to add the following selections under 'filterByTags' in web config: A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script. The tutorial only filters based on A href tags. So, if you're using IIS7 this is a great way to open up your calibre library to your kindle. |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Apr 2011
Device: Kindle 3
|
Just been trying to server Calibre Content via IIS 7 on Windows Home Server 2011.
I'm also struggling with the rules in URL Rewrite. What rule(s) did you end up using to make it work? |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Content Server | TonytheBookworm | Calibre | 2 | 09-07-2010 09:47 PM |
Need help - content server | Sydney's Mom | Calibre | 0 | 08-28-2010 04:07 PM |
content server in calibre | bruceOz | Calibre | 1 | 04-16-2010 04:23 AM |
Content Server Problem | HarryO53 | Calibre | 2 | 03-12-2010 11:07 AM |
Content Server | thibaulthalpern | Calibre | 5 | 04-28-2009 12:56 PM |