mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 14:35:52 +03:00
[GH-ISSUE #39] Unable to host under subpath #27
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Necklaces on GitHub (Mar 3, 2018).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/39
I'm trying to host shiori on port 7777 and then proxy pass https://localhost/shiori/ to that port, but when I do using this nginx config:
I get this result:
And the URL shows:
Any ideas? Seems like shiori redirects to
/(root).Manually going to
localhost/shiori/loginbrings up a broken login page, seemingly without both css, images, etc (can't click on anything).@RadhiFadlillah commented on GitHub (Mar 10, 2018):
Hi @Necklaces sorry for late response.
I'm sorry, unfortunately I don't have any experience using
nginx, so I can't give any advice. Usually I just usecaddysince it served HTTPs by default.If others has any advice or solution feels free to comment.
@peteretelej commented on GitHub (Mar 11, 2018):
proxy_redirectonly rewrites headers (eg Location), shiori redirects to /login, hence your should beproxy_redirect / $scheme://$host/shiori/;for the login page to redirect properly.However this will not work with assets requested directly eg /css/,/js/ etc unless a rewrite is used .eg.
for
location ~ ^/(css|js|api)to /shiori/, which I don't think would work well.The issue also applies to caddy if the proxy isn't root, and a
rewrite tofor all request isn't used. e.g.Possible fix: adding a webroot flag for server cmd so that it can be used for paths,
serve -webroot shiorithis would need changing of asset sources in html files + redirects to include the webroot variable.@ekianjo commented on GitHub (Sep 23, 2019):
@RadhiFadlillah can you provide a fix for this issue as suggested by @peteretelej ? Right now it's not possible to host it on a subdirectory with nginx...
@RadhiFadlillah commented on GitHub (Oct 7, 2019):
Guys, I've implemented this in 99d2793. To use it, config your proxy (in this example I use Caddy) like this :
Then run
shiori servewithwebrootflag set like this :By the way, the
webrootflag will change the entire API route to be prefixed with the specified root. For example, by running command above now the index is located inlocalhost:9000/shioriinstead oflocalhost:9000.@ekianjo commented on GitHub (Oct 7, 2019):
Wow very nice this deserves a new release!
On Monday, October 7, 2019, Radhi notifications@github.com wrote:
--
Raphael
@kimpers commented on GitHub (Oct 12, 2019):
I'm still having issues with this when using the docker image. After I login with
--webrootset the browser gets stuck in an infinite redirect loop.Reproduction case:
docker run -p 9000:9000 radhifadlillah/shiori:latest shiori serve -p 9000 --webroot /shioriIf I remove the
--webroot /shioriparameter then everything works as expected.@wangxu94 commented on GitHub (Dec 17, 2019):
I'm having the same issue as @kimpers above.
Reproduction:
shiori serve -p 8082 --webroot /shiori --portableEverything works fine without the webroot option.
@NBonaparte commented on GitHub (Apr 19, 2020):
If anyone's still interested, I think I found the source of the issue.
path.Jointrims the trailing slash if the path isn't/(see aa339d7706ef42b977f574bb77dee1c2ee3a1734)@davidnewhall commented on GitHub (Nov 5, 2020):
Now if only we can get that fix into the codebase. :) cc @deanishe
@Systemsemaphore commented on GitHub (Nov 12, 2020):
+1, I need this. Currently using binary
shiori-linux-amd64-stretch@rbdevr commented on GitHub (Nov 22, 2020):
hello all,
I'm trying to run shiori behind apache.
shiori - http://localhost:5000/shiori
shiori serve -p 5000 --webroot /shiori
apache - http://myserver/shiori
<Location "/shiori">Require all grantedProxyPass http://localhost:5000/shioriProxyPassReverse http://localhost:5000/shiori</Location>I'm getting the following error:
"
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
"
Are you guys working on this issue?
Cheers
@KarolBedkowski commented on GitHub (Jan 17, 2021):
Hi,
Cookie with session id has wrong path when shiori is served under subpath.
Above patch solve problem.
@stale[bot] commented on GitHub (Feb 10, 2022):
This issue has been automatically marked as stale because it has not had any activity for quite some time.
It will be closed if no further activity occurs.
Thank you for your contributions.
@efrecon commented on GitHub (Feb 16, 2022):
I have a fork that contains the fix from @NBonaparte above, and also generates an access log. I fixed the github workflows so they generate packages named after the organisation and repository hosting the project (i.e. not hardcoded to
go-shiori/shiori). In other words: Docker images are available within my fork if you wanted so.These are "good to have" changes. @fmartingr would you accept a PR?
@efrecon commented on GitHub (Feb 16, 2022):
On a side note: I noticed that this is marked with a
note:fixed?, but this isn't fixed entirely until what @NBonaparte proposed and/or the content of my fork is taken in.@fmartingr commented on GitHub (Feb 17, 2022):
Of course! This has to be one of the issues with the most activity, so if this is a requirement for you folks I will gladly accept a PR with the fix. The access log seems useful too, but it has to be optional (default to false) so people can avoid filling storage with it if they don't want to.
@davidnewhall commented on GitHub (Feb 17, 2022):
Fundamentally, access logs on web servers should never be disabled by default. Recommend log rotation by default.
@efrecon commented on GitHub (Feb 18, 2022):
PR #374 sent. As suggested by @davidnewhall, logging in on by default, but can be turned off with
--log=falseat the command-line if necessary.