Upload 5 files
Browse files- nginx.conf.template +2 -37
- start.sh +2 -6
nginx.conf.template
CHANGED
|
@@ -4,43 +4,8 @@ server {
|
|
| 4 |
absolute_redirect off;
|
| 5 |
port_in_redirect off;
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
location = / {
|
| 11 |
-
try_files /index.html =404;
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
location = ${PROXY_PATH} {
|
| 15 |
-
proxy_pass http://${CLI_PROXY_HOST}:${CLI_PROXY_PORT}/;
|
| 16 |
-
proxy_http_version 1.1;
|
| 17 |
-
proxy_set_header Host $host;
|
| 18 |
-
proxy_set_header X-Real-IP $remote_addr;
|
| 19 |
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 20 |
-
proxy_set_header X-Forwarded-Proto $scheme;
|
| 21 |
-
proxy_set_header Upgrade $http_upgrade;
|
| 22 |
-
proxy_set_header Connection "upgrade";
|
| 23 |
-
proxy_read_timeout 300;
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
location = ${PROXY_PATH}/v0/management {
|
| 27 |
-
return 301 ${PROXY_PATH}/v0/management/;
|
| 28 |
-
}
|
| 29 |
-
|
| 30 |
-
location ^~ ${PROXY_PATH}/v0/management/ {
|
| 31 |
-
proxy_pass http://${CLI_PROXY_HOST}:${CLI_PROXY_PORT}/v0/management/;
|
| 32 |
-
proxy_http_version 1.1;
|
| 33 |
-
proxy_set_header Host $host;
|
| 34 |
-
proxy_set_header X-Real-IP $remote_addr;
|
| 35 |
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 36 |
-
proxy_set_header X-Forwarded-Proto $scheme;
|
| 37 |
-
proxy_set_header Upgrade $http_upgrade;
|
| 38 |
-
proxy_set_header Connection "upgrade";
|
| 39 |
-
proxy_read_timeout 300;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
location ^~ ${PROXY_PATH}/ {
|
| 43 |
-
proxy_pass http://${CLI_PROXY_HOST}:${CLI_PROXY_PORT}/;
|
| 44 |
proxy_http_version 1.1;
|
| 45 |
proxy_set_header Host $host;
|
| 46 |
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
| 4 |
absolute_redirect off;
|
| 5 |
port_in_redirect off;
|
| 6 |
|
| 7 |
+
location / {
|
| 8 |
+
proxy_pass http://${CLI_PROXY_HOST}:${CLI_PROXY_PORT};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
proxy_http_version 1.1;
|
| 10 |
proxy_set_header Host $host;
|
| 11 |
proxy_set_header X-Real-IP $remote_addr;
|
start.sh
CHANGED
|
@@ -2,16 +2,12 @@
|
|
| 2 |
set -eu
|
| 3 |
|
| 4 |
if [ -z "${PROXY_PATH:-}" ]; then
|
| 5 |
-
PROXY_PATH="/
|
| 6 |
fi
|
| 7 |
case "${PROXY_PATH}" in
|
| 8 |
/*) ;;
|
| 9 |
*) PROXY_PATH="/${PROXY_PATH}" ;;
|
| 10 |
esac
|
| 11 |
-
if [ "${PROXY_PATH}" = "/" ]; then
|
| 12 |
-
echo "PROXY_PATH cannot be '/' because '/' is reserved for the cover page."
|
| 13 |
-
exit 1
|
| 14 |
-
fi
|
| 15 |
|
| 16 |
CONFIG_PATH="${CONFIG_PATH:-/data/config.yaml}"
|
| 17 |
AUTH_DIR="${AUTH_DIR:-/data/auth}"
|
|
@@ -63,7 +59,7 @@ if [ -d "/etc/nginx/http.d" ]; then
|
|
| 63 |
fi
|
| 64 |
|
| 65 |
export PROXY_PATH CLI_PROXY_HOST CLI_PROXY_PORT PORT
|
| 66 |
-
envsubst '${PORT} ${
|
| 67 |
< /etc/nginx/templates/default.conf.template \
|
| 68 |
> "${NGINX_CONF_DIR}/default.conf"
|
| 69 |
|
|
|
|
| 2 |
set -eu
|
| 3 |
|
| 4 |
if [ -z "${PROXY_PATH:-}" ]; then
|
| 5 |
+
PROXY_PATH="/"
|
| 6 |
fi
|
| 7 |
case "${PROXY_PATH}" in
|
| 8 |
/*) ;;
|
| 9 |
*) PROXY_PATH="/${PROXY_PATH}" ;;
|
| 10 |
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
CONFIG_PATH="${CONFIG_PATH:-/data/config.yaml}"
|
| 13 |
AUTH_DIR="${AUTH_DIR:-/data/auth}"
|
|
|
|
| 59 |
fi
|
| 60 |
|
| 61 |
export PROXY_PATH CLI_PROXY_HOST CLI_PROXY_PORT PORT
|
| 62 |
+
envsubst '${PORT} ${CLI_PROXY_HOST} ${CLI_PROXY_PORT}' \
|
| 63 |
< /etc/nginx/templates/default.conf.template \
|
| 64 |
> "${NGINX_CONF_DIR}/default.conf"
|
| 65 |
|