Skip to content

Commit 0247c63

Browse files
author
Dan Schaefer
authored
Merge pull request #2 from OnShift/AV-429-nginx-configuration-modification-for-iframe-support
Av 429 nginx configuration modification for iframe support
2 parents 2037048 + 782b347 commit 0247c63

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*~
22
*.swp
33
*.swo
4+
*.pem
5+

nginx/proxy_ssl.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ server {
3131
resolver_timeout 5s;
3232

3333
add_header Strict-Transport-Security max-age=15638400;
34-
add_header X-Frame-Options DENY;
34+
add_header X-Frame-Options "{{XFRAME_VALUE}}";
3535
add_header X-Content-Type-Options nosniff;
3636

3737
location / {

start.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,15 @@ fi
5252
# Tell nginx the address and port of the service to proxy to
5353
sed -i "s/{{TARGET_SERVICE}}/${TARGET_SERVICE}/g;" /etc/nginx/conf.d/proxy.conf
5454

55+
# Tell nginx if you want to block or allow iframing of pages and what domain name is allowed to iframe your content
56+
if [ -n "${XFRAME_OPTION+1}" ]; then
57+
echo "Applying iframe option..."
58+
sed -i "s/{{XFRAME_VALUE}}/${XFRAME_OPTION}/g;" /etc/nginx/conf.d/proxy.conf
59+
else
60+
echo "Denying iframes..."
61+
sed -i "s/{{XFRAME_VALUE}}/DENY/g;" /etc/nginx/conf.d/proxy.conf
62+
fi
63+
64+
5565
echo "Starting nginx..."
5666
nginx -g 'daemon off;'

0 commit comments

Comments
 (0)