Support custom host for prosody/portal
This commit is contained in:
parent
d4e9efb758
commit
cc0aa1ff90
|
@ -36,7 +36,7 @@ server {
|
||||||
|
|
||||||
location /upload/ {
|
location /upload/ {
|
||||||
client_max_body_size 16M;
|
client_max_body_size 16M;
|
||||||
proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT};
|
proxy_pass http://${SNIKKET_TWEAK_INTERNAL_HTTP_HOST}:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT};
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
|
|
@ -29,14 +29,14 @@ location /upload {
|
||||||
}
|
}
|
||||||
|
|
||||||
location @portal {
|
location @portal {
|
||||||
proxy_pass http://localhost:${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT};
|
proxy_pass http://${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_HOST}:${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT};
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
}
|
}
|
||||||
|
|
||||||
location @prosody {
|
location @prosody {
|
||||||
proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT};
|
proxy_pass http://${SNIKKET_TWEAK_INTERNAL_HTTP_HOST}:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT};
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export SNIKKET_TWEAK_HTTP_PORT=${SNIKKET_TWEAK_HTTP_PORT-80}
|
# Prosody host/port
|
||||||
export SNIKKET_TWEAK_HTTPS_PORT=${SNIKKET_TWEAK_HTTPS_PORT-443}
|
export SNIKKET_TWEAK_INTERNAL_HTTP_HOST=${SNIKKET_TWEAK_INTERNAL_HTTP_HOST-localhost}
|
||||||
export SNIKKET_TWEAK_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_INTERNAL_HTTP_PORT-5280}
|
export SNIKKET_TWEAK_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_INTERNAL_HTTP_PORT-5280}
|
||||||
|
|
||||||
|
# Portal host/port
|
||||||
|
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_HOST=${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_HOST-localhost}
|
||||||
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT-5765}
|
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT-5765}
|
||||||
|
|
||||||
exec envsubst '$SNIKKET_DOMAIN $SNIKKET_TWEAK_HTTP_PORT $SNIKKET_TWEAK_HTTPS_PORT $SNIKKET_TWEAK_INTERNAL_HTTP_PORT $SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT' \
|
# External ports
|
||||||
|
export SNIKKET_TWEAK_HTTP_PORT=${SNIKKET_TWEAK_HTTP_PORT-80}
|
||||||
|
export SNIKKET_TWEAK_HTTPS_PORT=${SNIKKET_TWEAK_HTTPS_PORT-443}
|
||||||
|
|
||||||
|
exec envsubst '$SNIKKET_DOMAIN $SNIKKET_TWEAK_HTTP_PORT $SNIKKET_TWEAK_HTTPS_PORT $SNIKKET_TWEAK_INTERNAL_HTTP_PORT $SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT $SNIKKET_TWEAK_INTERNAL_HTTP_HOST $SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_HOST' \
|
||||||
< "$1" \
|
< "$1" \
|
||||||
> "$2";
|
> "$2";
|
||||||
|
|
Loading…
Reference in New Issue