Calibre Nginx working configuration

Hi,

I’m working on getting a public-facing instance of Calibre up and running as a subdomain behind nginx. I’ve looked at the configuration here, but I know that to get this working it requires ssl.conf, proxy.conf, and resolver.conf that is gone over in this tutorial. Unfortunately, I’m not in a place where I can follow this tutorial and dockerize my ssl certs, so I am hoping to make a more homebrew nginx config work for now.

I’ve read a similar discussion here titled “Calibre (not (Calibre-web) installing docker and how to use https / ssl” that goes over how to make it a subfolder, but I honestly couldn’t get that to work either. I also know that this docker is built off of guacamole, so I tried to figure out by checking out guacamole documentation.

After trying all of this, I still can’t get it to work. What I mean by that is that I CAN get the nginx config to run and direct me to the proper place, but while Calibre works perfectly locally, through the proxy I get a blank page with a black dot on the middle left side that I can click in to. Once clicked into, I can access “On screen keyboard”, “File manager”, “Fit to window” and “Fullscreen” options, but the Calibre interface does not load. (I can provide an example url demonstrating this in private if it would help, and an image is shown below)

Here is my docker compose setup (slightly customized):

version: "2.1"
services:
  calibre:
    image: lscr.io/linuxserver/calibre
    container_name: calibre
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - PASSWORD= #optional
      - CLI_ARGS= #optional
    volumes:
      - /externalstorage/docker config files/calibre:/config
      - /externalstorage/Books:/config/Calibre Library
    ports:
      - 8084:8080
      - 8085:8081
    restart: unless-stopped

Here is my config file:

server {
  server_name calibre.DOMAIN.TLD;

  location / {

  proxy_set_header   Host $host;
  proxy_set_header   X-Real-IP $remote_addr;
  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header   X-Forwarded-Proto $scheme;
  proxy_pass         http://LOCALHOST:8084;
  proxy_read_timeout 90;
  #proxy_redirect     http://LOCALHOST:8084 http://calibre.DOMAIN.TLD;

}
}

Any ideas?

You can see the contents of those files referenced at our SWAG repo. They are all under root/defaults there

Apologies, when I looked around I noticed that they rely on another docker that you ran encryption through. Is there any way to get it to work without running that docker?

Is there anyone that can help me here? Still unresolved.

Since you are looking for custom support, it may be best to join our discord and enter #other-support for best effort help. Our templates are just simple nginx configs that can be easily modified for any nginx. If you aren’t sure how to use those, this forum isn’t the best place to ask that kind of stuff.

our suggestion would obviously be to use swag which would just require renaming a single file once it’s running to make this all work.

I’ll join the discord for help.

The problem is that the Nginx config works for bringing up the webpage, but the actual Calibre interface doesn’t load, the underlying assumption being that there is something different for how this container interfaces with nginx that is breaking it. Nginx configs that work with every other application on my server have the same errors for this one.

If I have to migrate all of my ssl certs to swag in order to get this to work then it’s just not worth it to me, and I’d rather not have duplicate nginx installations and certs for obvious reasons.

Unfortunately, since you’re doing your own thing, we can only tell you what works for us and all of our users. Someone may be willing to go over your custom config with you, but they may also just tell you to look at what we made (known working) and use that to go from… nginx is nginx.there’s also no moving certs, swag gets the certs for you. I can say with relative certainty, this is an issue in your config, not with calibre or nginx.