GithubHelp home page GithubHelp logo

Comments (12)

janeczku avatar janeczku commented on May 11, 2024 2

Hi @jgillman, i have calibre-web running w/o issues behind Nginx reverse proxy. But you are right in that it doesn't work if you reverse map it to some subfolder path.
I think i will add support for the X-Script-Name header. Then in Nginx you can pass the path prefix like this:

    location /calibre {
        proxy_pass http://127.0.0.1:8083;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Script-Name /calibre;
    }

from calibre-web.

janeczku avatar janeczku commented on May 11, 2024 1

@BzowK @jgillman Let me know if this works for you.

Nginx example:

server {
    location /calibre {
        proxy_pass http://127.0.0.1:8083;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Script-Name /calibre;
    }
}

from calibre-web.

jgillman avatar jgillman commented on May 11, 2024

That would work for me!

from calibre-web.

perler avatar perler commented on May 11, 2024

btw, to prevent access to the script on the original port, it would be nice to have a listen option where you specify the interface/IP the daemon is listening to. I see something like this already in cps.py but I think the place to put it is the config.ini

from calibre-web.

BzowK avatar BzowK commented on May 11, 2024

I, too, am trying to do this by adding it to my existing Windows-based installation of Apache. My other entries (mostly Python-based) are added to conf in the same format. Based on the port settings I configured for calibre-web, I tried adding the following:

<Location /calbooks>
order allow,deny
allow from all
ProxyPass http://localhost:8000
ProxyPassReverse http://localhost:8000
</Location>

When doing so and visiting https://mydomain/calbooks; only some text appears and links fail due to the fact there is no defined proxy path option. If I could configure the proxy path of "/calbooks" for within Apache or calibre-web and use the below, it should work; but obviously don't have the option or know how to do it.

<Location /calbooks>
order allow,deny
allow from all
ProxyPass http://localhost:8000/calbooks
ProxyPassReverse http://localhost:8000/calbooks
</Location>

Any suggestions for how to resolve this? Thanks!

from calibre-web.

jgillman avatar jgillman commented on May 11, 2024

@janeczku Works like a charm! Thanks for the feature.

from calibre-web.

hernandito avatar hernandito commented on May 11, 2024

Hi,

I am trying to achieve the same thing in regular Apache (not Nginx).

Any advise please??

	<Location /books>
		ProxyPass http://192.168.0.201:8032
		ProxyPassReverse http://192.168.0.201:8032
		 ProxyAddHeaders Host $http_host;
                ProxyAddHeaders X-Forwarded-For $proxy_add_x_forwarded_for;
		ProxyAddHeaders X-Scheme $scheme;
		ProxyAddHeaders X-Script-Name /books;
	</Location>	

Thank you.

H.

from calibre-web.

OzzieIsaacs avatar OzzieIsaacs commented on May 11, 2024

the example in the readme works for me

from calibre-web.

hernandito avatar hernandito commented on May 11, 2024

It did not for met... I will try again. Thank you!

from calibre-web.

hernandito avatar hernandito commented on May 11, 2024

no luck....

from calibre-web.

bcg62 avatar bcg62 commented on May 11, 2024

has anyone been able to do this with traefik? --url-prefix would make it easier but i havnt been able to find a way to mimic the nginx config

from calibre-web.

fmartinou avatar fmartinou commented on May 11, 2024

Hello @bcg62,
I make it work behind Traefik (v1.6.3) by adding the property passHostHeader = true in my frontend configuration.
Ex:

  [frontends.calibre]
  backend = "calibre"
  passHostHeader = true
    [frontends.calibre.routes.rule1]
    rule = "Host:calibre.mydomain.com"

from calibre-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.