SWAG + Calibre Content Server


I need some help setting up the Calibre Content Server behind SWAG and making it accessible to apps like MoonReader+/Librera/CalibreSync. So far I have Calibre running as a subdomain, i.e. https://calibre.myserver.duckdns.org, protected by Authelia, which works like intended. What I would like is to start the content server and use it via https://calibre.myserver.duckdns.org/content-server without exposing port 8081.

I tried adding this to the calibre.subdomain.conf file, but got nowhere:

location ~ (/calibre)?/content-server {                         
    # enable for Authelia                                       
    #include /config/nginx/authelia-location.conf;              
    include /config/nginx/proxy.conf;                           
    include /config/nginx/resolver.conf;                        
    set $upstream_app calibre;                                  
    set $upstream_port 8081;                                    
    set $upstream_proto http;                                   
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;  
    proxy_buffering off;                                        

If I could get this to work I would then try to use some reader app to connect to the content server, but first things first.

Thank you!

Try going into calibre preferences, sharing over the net and Advanced. First option allows you to set a base url. Set it to /content-server. Save and restart the container. See if it works (your proxy conf addition is trying to connect to the content server at local address http://calibre:8081/content-server and with that setting, it would match).

If that doesn’t work, you can set up a new subdomain proxy just for the content server

First, undo that setting from the option above, make sure the prefix is blank.

Then duplicate the main calibre subdomain proxy conf file (ie. calibrecs.subdomain.conf) and edit the server_name to read something like calibrecs.* and change the $upstream_port to 8081 and leave everything else the same.

Then you’ll access it at https://calibrecs.myserver.duckdns.org

1 Like

Wow, that was quick. And worked like a charm, thank you!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.