Closed AlexKalopsia closed 3 years ago
http
was intentional, yes. At the time, it didn't like it when I set that to https
. In my own installation of webtrees behind a reverse proxy, I have both LOGIN_URL
and SERVER_URL
set to the external address with https
and it works finePRETTY_URLS
doesn't do anything other make the URLs look nicer. HTTPS_REDIRECT
isn't necessary, but if you have HTTPS
enabled, it redirects from HTTP to HTTPS automatically. You issue here likely is BASE_URL
. That absolutely must be the domain/hostname you're accessing webtrees by. For example with my own installation, while you could access it via http://localdockerip:80
I access it as https://webtrees.nathanv.app
, so I set BASE_URL
to that.DB
is used every time you start the container to generate a config file for webtrees to connect to the database, so that's fine. It's anything that starts with WT
is used exactly once to initialize the database with the first user account. There's no changes needed there to externalize it. The only two things you might need to change are LOGIN_URL
and SERVER_URL
in the table wt_site_setting
as discussed above. I'm not positive is webtrees changes this automatically from the config file. My own docker-compose.yml
for reference:
version: '3'
services:
app:
env_file:
- ./.env
image: ghcr.io/nathanvaughn/webtrees:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.webtrees.rule=Host(`webtrees.nathanv.app`)"
- "traefik.http.routers.webtrees.service=webtrees"
- "traefik.http.services.webtrees.loadbalancer.server.port=80"
- "traefik.http.routers.webtrees.entrypoints=secure"
- "traefik.http.routers.webtrees.tls=true"
- "traefik.http.routers.webtrees.tls.certresolver=le"
- "traefik.http.routers.webtrees.tls.domains[0].sans=*.nathanv.app"
networks:
- db_net
- proxy_net
restart: unless-stopped
volumes:
- app_data:/var/www/webtrees/data/
- app_media:/var/www/webtrees/media/
- app_modules:/var/www/webtrees/modules_v4/
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
volumes:
app_data:
driver: local
app_media:
driver: local
app_modules:
driver: local
networks:
db_net:
external: true
proxy_net:
external: true
And .env
PRETTY_URLS=1
LANG=en-US
BASE_URL=https://webtrees.nathanv.app
DB_TYPE=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_USER=webtrees
DB_PASS=<databasepassword>
DB_NAME=webtrees
DB_PREFIX=wt_
WT_USER=nathan
WT_NAME="Nathan Vaughn"
WT_PASS=<userpassword>
WT_EMAIL=<useremail>
Closing due to several months with no response
Hi Nathan,
I somehow missed all the replies. Just wanted to let you know that I eventually managed to make this work. The only thing I did were:
1) Manually add LOGIN_URL
to the database, and make it point to https://tree.mydomain.com
2) Manually add SERVER_URL
to the database, and make it point to https://tree.mydomain.com
3) Set BASE_URL
to https://tree.mydomain.com
4) Set PRETTY_URLS
to 1
Thanks again for the support
Interesting, I'll add the note about setting SERVER_URL
to the database. Webtrees is definitely a little finnicky about running behind a reverse proxy.
Hi and thanks for this Docker image. I have been using WebTrees for a week or so now and I love it. I initially tried to setup external HTTPS access, but I cound't manage to (I kept failing to reach WebTrees), so I ended up going for a simpler local access.
I currently reach WebTrees on http://myip:port. I am running the Docker comtainer on a Synology NAS, connecting to a separate MariaDB container. Note that I use swag (nginx) as reverse proxy solution to reach all my containers externally.
My docker-compose currently looks like this:
Now that I have a pretty big tree, I would like to share it with other family members, but I am obviously still struggling to understand how to do that. The goal is to reach WebTrees via a subdomain using HTTPS. This is what I did so far:
wt_site_setting
, i have addedLOGIN_URL
with valuehttps://tree.domain.com/login.php
, andSERVER_URL
with valuehttp://tree.domain.com
. Is this necessary? Also, is it intentional that the second uses HTTP protocol instead of HTTPS?trusted_headers="cf-connecting-ip"
to myconfig.ini.php
file, ortrusted_proxies="192.168.x.x"
(server ip).PRETTY_URLS=1
,HTTPS=1
,HTTPS_REDIRECT=1
in the docker-compose. This seems fine, but I noticed that I started getting some really odd redirect fromhttps://my.domain.com
to my server homepage (rather than the correct container port. IsHTTPS_REDIRECT
necessary?My nginx config looks like this:
I think this pretty much covers all my questions, I hope someone can help me out with this process. Thank you!