Calibre behind apache server sometimes returns 'localhost' URLs

Bug #1238987 reported by Eric Hameleers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

The issue has been present for as long as I am running a Calibre server which is since 0.8.x. Currently running calibre-1.6.0.

I run calibre-server on Slackware Linux 13.37. The Calibre server is proxied behind an Apache server using RewriteRules.

In the interface exposed by Apache, most category links work properly (Newest, All books, Authors, ...).
However, the following three category links are not working: Virtual Libs, News and Searches.
When I click these, the base part of the URL which is returned to the browser has changed from the expected "http://myserver.net/" to "http://localhost:9090/" which is the rewrite URL I have defined in the Apache configuration.
An exaample of an URL which the browser is instructed to load is:
   http://localhost:9090/calibre/browse/matches/virt_libs/426f656b656e

I have been browsing through the calibre code but I am not knowledgeable enough to understand the flow of the HTTP server.

Here is my configuration:

Apache's httpd.conf rewrite rules (leaving the SetEnv lines out does not make a difference):

    RewriteRule ^/calibre/$ http://localhost:9090 [proxy]
    RewriteRule ^/calibre/(.*) http://localhost:9090/calibre/$1 [proxy]
    RewriteRule ^/calibre http://localhost:9090 [proxy]

    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1

The calibre-server startup commandline:

   calibre-server --daemonize --auto-reload --with-library=/store/CalibreLibrary --pidfile=/var/run/calibre_alien.pid --max-cover=600x800 --url-prefix=/calibre --port=9090

The server URL exposed by Apache is "http://myserver.net/calibre" due the the use of the "--url-prefix" parameter to calibre-server. As said, this works perfectly for everything except the Virtual Libs, News and Searches categories.
I do have a virtual library defined in Calibre, and I am fetching a news source every day. I do not have saved searches.

Would be obliged if you are willing to look into this.

Cheers, Eric Hameleers

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
Eric Hameleers (a2ien) wrote :

Hi Kovid

It's indeed working properly now, thanks!

Cheers, Eric Hameleers

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.