Skip to content

Commit 910c4b3

Browse files
authored
Merge pull request #20 from pascalberger/feature/gh-16
(GH-16) Fix redirection on root site if not running on port 80
2 parents fc2f9a9 + dabd4d4 commit 910c4b3

File tree

4 files changed

+1
-14
lines changed

4 files changed

+1
-14
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM nginx:1.17.3-alpine
22
LABEL MAINTAINER="BBT Software AG <devadmin@bbtsoftware.ch>"
33

4-
ENV CHK_URL monitor.tempuri.org
54
ENV CHK_DOCKER_API_VERSION v1.38
65
ENV CHK_INTERVAL 60
76
ENV CHK_MONITOR prtg

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ These environment variables are supported:
4848
| ENV field | Example values | Description |
4949
|------------------------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------|
5050
| TZ | `Europe/Zurich` | Timezone to set. |
51-
| CHK_URL | `monitor.tempuri.org` | Base url to use for nginx redirect. This will be set to `http://{CHK_URL}/status.json`. |
5251
| CHK_DOCKER_API_VERSION | `v1.38` | Docker API version to use. Default is `v1.38`. |
5352
| CHK_INTERVAL | `60` | Interval for check in seconds. Default is `60`. |
5453
| CHK_MONITOR | `prtg` | Used monitoring. Defines the format of the `status.json`. Currently supported is `prtg`. |
@@ -70,7 +69,6 @@ services:
7069
- 80:80
7170
environment:
7271
- TZ=Europe/Zurich
73-
- CHK_URL=monitor.tempuri.org
7472
- CHK_DOCKER_API_VERSION=v1.38
7573
- CHK_INTERVAL=60
7674
- CHK_MONITOR=prtg
@@ -88,7 +86,6 @@ docker run -d \
8886
-v /var/run/docker.sock:/var/run/docker.sock \
8987
-p 80:80 \
9088
-e TZ=Europe/Zurich \
91-
-e CHK_URL=monitor.tempuri.org \
9289
-e CHK_DOCKER_API_VERSION=v1.38 \
9390
-e CHK_INTERVAL=60 \
9491
-e CHK_MONITOR=prtg \

docker-entrypoint.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
#!/bin/sh
22

3-
set_redirect_url () {
4-
echo
5-
echo "Setting redirect url in index.html to 'http://${CHK_URL}/status.json' ..."
6-
sed -i "s|{URL}|${CHK_URL}|g" /usr/share/nginx/html/index.html
7-
echo " ... done."
8-
}
9-
103
start_http () {
114
echo
125
echo "Starting nginx ..."
@@ -58,8 +51,6 @@ check_services () {
5851
echo $output | jq '.' > /usr/share/nginx/html/status.json
5952
}
6053

61-
set_redirect_url
62-
6354
start_http
6455

6556
show_services

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<html>
22
<head>
3-
<meta http-equiv="Refresh" content="0; url=http://{URL}/status.json" />
3+
<meta http-equiv="Refresh" content="0; url=/status.json" />
44
</head>
55
</html>

0 commit comments

Comments
 (0)