-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apache reverse proxy does not work for me #883
Comments
I'm not familiar with Apache2, but have you tried setting the if you wouldn't mind when you have it ready and working can you submit a PR to add Apache2 sample configuration in the documentation same we did with nginx? It would be really appreciated. |
Thank you for responding. Adding --webroot /shiori and browsing for http:https://192.168.1.180/shiori
while without --webroot http:https://192.168.1.180/shiori gives: a white screen with a tab "Shiori - Bookmarks Manager"
http:https://192.168.1.180:8080
I tried with ngnix-proxy-manager and pointed it at http:https://192.168.1.180:8080 and got the same white screen with correct tab in firefox I hope the log tell you something. |
I believe you need to use the
|
OK, some progress and some problems. I start shiori (with: It now starts with http:https://192.168.1.180/shiori = progress Something goes wrong here! Shiori in Docker: docker run -d Gives a WHITE screen. http:https://1902.168.1.180:8080 What can I do to make it work? |
I think the simpliest solution would be to spin up shiori and the reverse proxy together via docker. # docker-compose.yaml
version: "3.8"
services:
web:
image: nginx:alpine
restart: unless-stopped
ports:
- 80:80
volumes:
- /home/debian/Docker/shiori/shiori-nginx.conf:/etc/nginx/conf.d/default.conf:ro
shiori:
image: ghcr.io/go-shiori/shiori
restart: unless-stopped
command: ["serve", "--webroot", "/shiori"]
environment:
- SHIORI_DIR=/data
- SHIORI_HTTP_ROOT_PATH=/shiori
volumes:
- /home/debian/Docker/shiori/data:/data
You need to create the
From the directory of the docker-compose up -d and the shiori should be accessible via http:https://<your_ip>/shiori IMPORTANT Make sure that no other process on the machine (e.g. apache2) is listening on port 80, otherwise you will receive an error on starting the docker containers similar to docker: Error response from daemon: Bind for 0.0.0.0:80 failed: port is already allocated. |
Thank you for your write-up of a possible solution. I really appreciate it.
What I try to achieve is that I can access all my Docker containers from a browser with a name. Therefore I need some reverse proxy rules (in apache2). But those simple rules do not seem to work for shiori. Bummer. |
Change the Anything in the apache logs or Shiori logs? you should see the environment variable configuration on shiori boot, are all variables correct? |
I start a shiori docker with: docker run -d In apache i have these rules:
I start shiori from a browser with http:https://192.168.1.180/shiori/ The apache access log gives: 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/css/style.css HTTP/1.1" 404 425 "http:https://192.168.1.180/shiori/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/vue.min.js HTTP/1.1" 404 426 "http:https://192.168.1.180/shiori/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/url.min.js HTTP/1.1" 404 426 "http:https://192.168.1.180/shiori/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/page/base.js HTTP/1.1" 404 425 "http:https://192.168.1.180/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/page/home.js HTTP/1.1" 404 425 "http:https://192.168.1.180/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/page/setting.js HTTP/1.1" 404 425 "http:https://192.168.1.180/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" 192.168.1.107 - - [20/Apr/2024:11:58:38 +0200] "GET /assets/js/component/dialog.js HTTP/1.1" 404 426 "http:https://192.168.1.180/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"` On my browserscreen I see this: (empty white screen) |
If, in a browser, I add login to the url (http:https://192.168.1.180/shiori/login) |
Understood. How does your whole shiori vhost config looks like? Not quite familiar with apache2 but did you try to test without
These rules might mess it up. |
@nliakm
this is just there to make sure I can either type http:https://url/shiori or http:https://url/shiori**/** (note the / trailing slash) My vhosts looks like this:
< /VirtualHost>. (without a " " before the /) |
I think the problem is about the trailing slashes. How about turning the rule around? You could still type both with that way.
|
That gives the same white screen and an error 500 when I type http:https://url/shiori/login. and when I change the virthost to: I get a 404 page not found error. There must be something we are missing....... |
I use following command |
I used to start a docker container with @fmartingr asked me to change this to If I start docker-shiori with both -e varables active: same effect, white screen with "Shiori - bookmark manager" in the tab. http:https://192.168.1.180:8080 still works (gives an error and after OK I get the login screen) Maybe that is the error 404 that I keep seeing? Bit not on screen. |
http:https://192.168.1.180:8080/ works because with that you directly connect to the shiori docker container without going over apache2 reverse proxy.
|
@nliakm If I do exactly as you suggested I can login to shiori with http:https://192.168.1.180/shiori. Great, 1 step forward. I did not know this was possible. If I try to use a saved bookmark it then shows the readable view. Another step forward. However if I then try to view the Archive it shows this page: The same happens if I save another bookmark and then try to view the archive. 1 step back. If I try to login with http:https://192.168.1.180:8080 I get a white screen. Another step back? EDIT: If I revert shiori to the previous container the old archive data seems to be corrupted. |
I tried your setup and it looks more like a bug than a configuration problem. I'm not a developer myself, but I think the cause of the problem lies in this file: The archive will be rendered via iframe and is harcoded using the path starting with So if maybe the |
Thank you for figuring this out. The thing is that reverse proxy with nginx seems to work (have not verified this, I do not use nginx). Have you verified this? Interesting that this does not work with apache2. |
I cannot tell. I run shiori inside kubernetes and use a subdomain shiori.mydomain.com instead of the /shiori route. |
Do you use docker with shiori or native? I think the developer and I have a different understanding of what a /webroot in docker with apache2 reverse proxy should be. For me all shiori files should be relative to the /webroot used in apache reverse proxy. It looks like shiori is programmed different. |
I decided to take your "route". I got some inspirations from audiobookshelf where the developer could not get http:https:///audiobookshelf to work and gave this as a workaround. I run my own DNS (DNSmasq) on my LAN. So I put [192.168.1.180 shiori.lan] in the hosts file of the DNSmasq server. In apache I now just need:
in the apache2 virtualhosts.conf This works for shiori.lan but obviously not for 192.168.1.180/shiori Problem not solved, but workaround is OK. |
This issue has been automatically marked as stale because it has not had any activity for quite some time. |
Problem not solved. Topic should stay active. |
This issue has been automatically marked as stale because it has not had any activity for quite some time. |
Data
Describe the bug / actual behavior
Started shiori with:
shiori server --storage-directory /home/debian/shiori/data
I go to shiori in a browser http:https://localhost:8080 it works (I can login etc.)
I try to make a reverse proxy in apache2 virtualhosts
RewriteEngine on
RewriteRule ^/shiori$ /shiori/ [R]
ProxyPreserveHost On
ProxyRequests off
<Location /shiori/>
Require all granted
ProxyPass http:https://192.168.1.180:8080/
ProxyPassReverse http:https://192.168.1.180:8080/
</Location>
Expected behavior
In a brwoser:
http:https://localost/shiori should give a shiori login screen
What i get
a white browser screen with "Shiori - Bookmarks Manager" in the tab
So I am forwarded to the right place, but something in the code refuses this.
What am I doing wrong?
Am I missing a setting?
The text was updated successfully, but these errors were encountered: