I installed weblate following the docker instructions from the documentation
https://docs.weblate.org/en/latest/admin/install/docker.html#installing-using-docker
git clone https://github.com/WeblateOrg/docker-compose.git weblate-docker
cd weblate-docker
docker-compose up
my docker-compose.override.yml looks like this
version: '3'
services:
weblate:
ports:
- 127.0.0.1:80:8080
environment:
WEBLATE_DEBUG: 1
WEBLATE_ENABLE_HTTPS: 1
WEBLATE_EMAIL_HOST: smtp.example.com
WEBLATE_EMAIL_HOST_USER: [email protected]
WEBLATE_EMAIL_HOST_PASSWORD: xxxxxxxxxxxxxx
WEBLATE_SERVER_EMAIL: [email protected]
WEBLATE_DEFAULT_FROM_EMAIL: [email protected]
WEBLATE_SITE_DOMAIN: weblate.example.com
WEBLATE_ADMIN_PASSWORD: xxxxxxxxxxxxxx
WEBLATE_ADMIN_EMAIL: [email protected]
IP_BEHIND_REVERSE_PROXY: 1
my apache virtual host looks like this
<VirtualHost 123.123.123.123:80>
ServerName weblate.example.com
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80
ProxyPassReverse / http://127.0.0.1:80
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/errorr.weblate.example.com.log
CustomLog ${APACHE_LOG_DIR}/access.weblate.example.com.log combined
</VirtualHost>
and netstat shows this :
root@dark:~# netstat -tulpen | grep apache
tcp 0 0 123.123.123.123:80 0.0.0.0:* LISTEN 0 84254390 29773/apache2
tcp 0 0 123.123.123.123:443 0.0.0.0:* LISTEN 0 84254392 29773/apache2
root@dark:~# netstat -tulpen | grep docker
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 0 84215870 22655/docker-proxy
from localhost I can connect perfectly to weblate
but for some strage reason it does not work from other locations
the apache error log file shows the following
[Sat Mar 05 16:47:31.484813 2022] [proxy:debug] [pid 5969] proxy_util.c(2122): AH00925: initializing worker http://127.0.0.1 shared
[Sat Mar 05 16:47:31.485042 2022] [proxy:debug] [pid 5969] proxy_util.c(2182): AH00927: initializing worker http://127.0.0.1 local
[Sat Mar 05 16:47:31.485088 2022] [proxy:debug] [pid 5969] proxy_util.c(2230): AH00931: initialized single connection worker in child 5969 for (127.0.0.1)
what is going on here ?
btw. my reputation is not enough to add "weblate" as tag. I whould ask someone to do it for me please.
UPDATE
After switching from Loglevel debug to trace1 and disabling https in weblate
WEBLATE_ENABLE_HTTPS: 0
now I can see the site but all static content is missing this is what the error log is showing
[Sat Mar 05 17:37:47.028955 2022] [proxy:debug] [pid 23458] proxy_util.c(2230): AH00931: initialized single connection worker in child 23458 for (127.0.0.1)
[Sat Mar 05 17:37:47.030834 2022] [proxy:error] [pid 23343] [client 123.123.123.123:57150] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/vendor/prism/prism-rest.js, referer: https://weblate.example.com/
[Sat Mar 05 17:37:47.031211 2022] [proxy:error] [pid 23378] [client 123.123.123.123:57147] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/vendor/prism/prism-markdown.js, referer: https://weblate.example.com/
[Sat Mar 05 17:37:47.034849 2022] [proxy:error] [pid 23381] [client 123.123.123.123:57148] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/vendor/prism/prism-icu-message-format.js, referer: https://weblate.example.com/
[Sat Mar 05 17:37:47.051929 2022] [proxy:error] [pid 23379] [client 123.123.123.123:57151] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/loader-bootstrap.js, referer: https://weblate.example.com/
[Sat Mar 05 17:37:47.261559 2022] [proxy:error] [pid 23378] [client 123.123.123.123:57147] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/weblate-180.png, referer: https://weblate.example.com/
[Sat Mar 05 17:37:47.265804 2022] [proxy:error] [pid 23380] [client 123.123.123.123:57149] AH00898: DNS lookup failure for: 127.0.0.1:80static returned by /static/logo-16.png, referer: https://weblate.example.com/
[Sat Mar 05 17:37:50.040236 2022] [proxy:debug] [pid 23459] proxy_util.c(2122): AH00925: initializing worker http://127.0.0.1 shared
[Sat Mar 05 17:37:50.040294 2022] [proxy:debug] [pid 23459] proxy_util.c(2182): AH00927: initializing worker http://127.0.0.1 local
[Sat Mar 05 17:37:50.040315 2022] [proxy:debug] [pid 23459] proxy_util.c(2230): AH00931: initialized single connection worker in child 23459 for (127.0.0.1)
the access log is showing a 502 error for all static content
123.123.123.123 - - [05/Mar/2022:17:37:46 +0100] "GET /static/vendor/slugify.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/tribute.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/prism/prism-core.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/prism/prism-markup.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/prism/prism-rest.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/prism/prism-markdown.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/vendor/prism/prism-icu-message-format.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/loader-bootstrap.js?v=4.11 HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/weblate-180.png HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
123.123.123.123 - - [05/Mar/2022:17:37:47 +0100] "GET /static/logo-16.png HTTP/1.1" 502 661 "https://weblate.example.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
I found this: How can I get apache to serve static content in a reverse-proxied setup? but is does not help me very much because I am using docker and I do not known how to detemine the docker DocumentRoot