Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2010, 09:36 AM   #1
abrinton
Junior Member
abrinton began at the beginning.
 
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
abrinton is offline   Reply With Quote
Old 04-30-2010, 09:41 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,663
Karma: 4998489
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
kovidgoyal is offline   Reply With Quote
Old 04-30-2010, 10:10 AM   #3
abrinton
Junior Member
abrinton began at the beginning.
 
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?
abrinton is offline   Reply With Quote
Old 04-30-2010, 10:55 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,663
Karma: 4998489
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.
kovidgoyal is offline   Reply With Quote
Old 04-30-2010, 03:17 PM   #5
abrinton
Junior Member
abrinton began at the beginning.
 
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
abrinton is offline   Reply With Quote
Old 04-30-2010, 04:11 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,663
Karma: 4998489
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
kovidgoyal is offline   Reply With Quote
Old 04-30-2010, 04:50 PM   #7
abrinton
Junior Member
abrinton began at the beginning.
 
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.
abrinton is offline   Reply With Quote
Old 04-30-2010, 06:45 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,663
Karma: 4998489
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
kovidgoyal is offline   Reply With Quote
Old 06-19-2010, 09:58 AM   #9
abrinton
Junior Member
abrinton began at the beginning.
 
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.
abrinton is offline   Reply With Quote
Old 04-08-2011, 01:26 PM   #10
HughMcC
Junior Member
HughMcC began at the beginning.
 
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?
HughMcC is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:43 AM.


MobileRead.com is a privately owned, operated and funded community.