Skip to content

Commit 7dd7568

Browse files
committed
changes sed delimiter so URLs can be set without escaping /
1 parent 0247c63 commit 7dd7568

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

start.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414

15-
# Env says we're using SSL
15+
# Env says we're using SSL
1616
if [ -n "${ENABLE_SSL+1}" ] && [ "${ENABLE_SSL,,}" = "true" ]; then
1717
echo "Enabling SSL..."
1818
cp /usr/src/proxy_ssl.conf /etc/nginx/conf.d/proxy.conf
@@ -21,10 +21,10 @@ else
2121
cp /usr/src/proxy_nossl.conf /etc/nginx/conf.d/proxy.conf
2222
fi
2323

24-
# If an htpasswd file is provided, download and configure nginx
24+
# If an htpasswd file is provided, download and configure nginx
2525
if [ -n "${ENABLE_BASIC_AUTH+1}" ] && [ "${ENABLE_BASIC_AUTH,,}" = "true" ]; then
2626
echo "Enabling basic auth..."
27-
sed -i "s/#auth_basic/auth_basic/g;" /etc/nginx/conf.d/proxy.conf
27+
sed -i "s;#auth_basic;auth_basic;g;" /etc/nginx/conf.d/proxy.conf
2828
fi
2929

3030
# If the SERVICE_HOST_ENV_NAME and SERVICE_PORT_ENV_NAME vars are provided,
@@ -50,15 +50,15 @@ if [ -n "${SERVICE_PORT_ENV_NAME+1}" ]; then
5050
fi
5151

5252
# Tell nginx the address and port of the service to proxy to
53-
sed -i "s/{{TARGET_SERVICE}}/${TARGET_SERVICE}/g;" /etc/nginx/conf.d/proxy.conf
53+
sed -i "s;{{TARGET_SERVICE}};${TARGET_SERVICE};g;" /etc/nginx/conf.d/proxy.conf
5454

5555
# Tell nginx if you want to block or allow iframing of pages and what domain name is allowed to iframe your content
5656
if [ -n "${XFRAME_OPTION+1}" ]; then
5757
echo "Applying iframe option..."
58-
sed -i "s/{{XFRAME_VALUE}}/${XFRAME_OPTION}/g;" /etc/nginx/conf.d/proxy.conf
58+
sed -i "s;{{XFRAME_VALUE}};${XFRAME_OPTION};g;" /etc/nginx/conf.d/proxy.conf
5959
else
6060
echo "Denying iframes..."
61-
sed -i "s/{{XFRAME_VALUE}}/DENY/g;" /etc/nginx/conf.d/proxy.conf
61+
sed -i "s;{{XFRAME_VALUE}};DENY;g;" /etc/nginx/conf.d/proxy.conf
6262
fi
6363

6464

0 commit comments

Comments
 (0)