gramps-project / gramps-web

Frontend for Gramps Web
https://www.grampsweb.org
GNU Affero General Public License v3.0
336 stars 48 forks source link

Promlem with GRAMPSWEB_BASE_URL #431

Closed mpadwick closed 2 months ago

mpadwick commented 2 months ago

Hi I'm experimenting with running a docker version of grampsweb. I uses this file docker-compose.yml, modified it with the GRAMPSWEB_BASE_URL the appropriate environment section, to match my needs. GRAMPSWEB_BASE_URL: "https://www.domain.com/familytree/"

I'm also running this through a caddy setup using it as a revere proxy. This is my caddy config for grampsweb:

        redir /familytree /familytree/ 301
        handle_path /familytree/* {
                reverse_proxy http://grampsweb:5000 {
                        header_up Host {host}
                        header_up X-Real-IP {remote_host}
                        header_up X-Forwarded-For {remote_host}
                }
        }

I can see the traffic pass through the reverse proxy, but it dos not seem to like the base url. The uri dose not use the /familytree/sw.js as expected resulting in 404 errors. This is my caddy log

{"level":"error","ts":1713810509.489727,"logger":"http.log.access.log0","msg":"handled request","request":
{"remote_ip":"<my ip>","remote_port":"41294","client_ip":"<my ip>","proto":"HTTP/2.0","method":
"GET","host":"www.domain.com","uri":"/sw.js","headers":{"Accept-Encoding":["gzip, deflate, br, zstd"],"Cookie":[
],"Service-Worker":["script"],"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-Mode":["same-origin"],"Sec-Fetch-Dest"
:["serviceworker"],"Referer":["https://www.domain.com/familytree/"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"],"Cache-Control":["max-age=0"],
"Accept":["*/*"],"Accept-Language":["en-GB,en-US;q=0.9,en;q=0.8"]},"tls":"resumed":false,"version":772,
"cipher_suite":4867,"proto":"h2","server_name":"www.domain.com"}},"bytes_read":0,"user_id":"","durati
on":0.00078586,"size":0,"status":404,"resp_headers":{"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"]}}

What am I doing wrong? Is this not the intent of the GRAMPSWEB_BASE_URL variable?

Appreciate any input.

DavidMStraub commented 2 months ago

Hi @mpadwick, I'll convert your question from issue to discussion as it is a question about setup.