I have my own pages-server running and it does a great job serving up the /index.html page content. However if I try going to an internal page (like /about.html or /about/index.html), it's returning empty <head> and <body> tags so the page is completely blank. It does appear to be routing correctly though, because if I go to a page that doesn't exist I get the "Page not found" error instead of the blank page. Is this a common misconfiguration you've seen before? Thank you!
Internal pages blank #164
I can confirm this problem. However, I also run into it on pages with index.html.
I get no errors in the console, even with DEBUG set to true.
Edit: removing the `key-database.pogreb seems to solve the problem temporarily.
Is the data modified, or maybe corrupted? (Like, just missing the rest of the page)? I think I've seen something like this before.
If I systemctl restart pages-server the first hard refresh on any of these internal pages will work. However, any subsequent refresh results in the blank page (besides the homepage which works consistently).
Sounds like the cache is not actually returning the data that it thinks it has.
Is there a way to disable the cache?
Potentially related issue: #142
Are there debugging steps we could take to pinpoint what is causing this? Thanks!
Ah yes, thank you for the link. Right, we had issues of incomplete content when directly accessing the Gitea server without a reverse proxy.
We decided against digging deeper and just reverting the configuration change :'(
Is the configuration change something in your environment, or in the project that has been updated? I'm running the latest release (v4.5) but still seem to be encountering the issue. I'm not clear if pages-server is doing the reverse proxying or if you're using a separate service for that. Thank you!
If you specify your server address, you could either use a public facing URL (e.g. https://codeberg.org/) or an internal one (e.g. http://gitea-production.lxc.local:3000/). We use the former. When we tried the latter for a more direct connection, we had this issue.
I'm setting GITEA_ROOT to a fully qualified domain name (public facing URL). Is there another place I should specifying this?
I think the next debugging step would be to use a traffic analyzer like wireshark to see what is actually going on and where a request might stop working ...
I've pinpointed this problem to ~ line 165 in server/upstream/upstream.go:
// Append trailing slash if missing (for index files), and redirect to fix filenames in general// o.appendTrailingSlash is only true when looking for index pagesifo.appendTrailingSlash&&!strings.HasSuffix(ctx.Path(),"/"){ctx.Redirect(ctx.Path()+"/",http.StatusTemporaryRedirect)returntrue}Commenting this block out completely allows internal pages in format of mysite.com/about/index.html to load correctly (mysite.com/about.html still won't work).
were you getting a blank page for /about/index.html before? you were supposed to get a redirect to /about/ which would serve up the content of index.html.
that line of code isn't even responsible for that redirect, it's just supposed to redirect you from /about to /about/
Yeah it's really weird, not the fix I was expecting. It's actually just the return that's causing the issue (not the whole block). My site hydrates to an SPA and the clientside router uses URLs without the trailing slash. So when that conditional is evaluating to true and returning at this point it must be preventing a critical block further down from running?
Yes going to /about/index.html or /about/ would be blank (unless going there right after a systemctl restart pages-server and the first page loaded like this would continue to work 🤷). My homepage /index.html always worked.
Wow, that's really confusing.
An alle pages-server admins & devs, i have created an dedicated room: https://matrix.to/#/!VTsiUcuAxMmLxesQRa:obermui.de?via=obermui.de
No due date set.
No dependencies set.
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?