File tree Expand file tree Collapse file tree 4 files changed +32
-22
lines changed Expand file tree Collapse file tree 4 files changed +32
-22
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ ADD ./go.sh /
2626ADD ./enable_location.sh /
2727ADD ./location_template.conf /
2828ADD ./logging.conf /usr/local/openresty/nginx/conf/
29+ ADD ./security_defaults.conf /usr/local/openresty/nginx/conf/
2930ADD ./html/ /usr/local/openresty/nginx/html/
3031ADD ./readyness.sh /
3132ADD ./helper.sh /
Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ cat > ${NGIX_LISTEN_CONF} <<-EOF-LISTEN
3535 listen localhost:${INTERNAL_LISTEN_PORT} ssl;
3636EOF-LISTEN
3737
38+ if [ " ${CUSTOM_SECURITY_DEFAULTS} " == " TRUE" ]; then
39+ msg " Disabling inbuilt security headers add per location"
40+ > /usr/local/openresty/nginx/conf/security_defaults.conf
41+ fi
42+
3843if [ " ${LOAD_BALANCER_CIDR} " != " " ]; then
3944 msg " Using proxy_protocol from '$LOAD_BALANCER_CIDR ' (real client ip is forwarded correctly by loadbalancer)..."
4045 export REMOTE_IP_VAR=" proxy_protocol_addr"
@@ -72,10 +77,12 @@ if [ -z ${DISABLE_SYSDIG_METRICS+x} ]; then
7277EOF-SYSDIG-SERVER
7378fi
7479
75- IFS=' ,' read -a LOCATIONS_ARRAY <<< " $LOCATIONS_CSV"
76- for i in " ${! LOCATIONS_ARRAY[@]} " ; do
77- /enable_location.sh $(( ${i} + 1 )) ${LOCATIONS_ARRAY[$i]}
78- done
80+ if [ " ${CUSTOM_PROXY_CONFIG} " != " TRUE" ]; then
81+ IFS=' ,' read -a LOCATIONS_ARRAY <<< " $LOCATIONS_CSV"
82+ for i in " ${! LOCATIONS_ARRAY[@]} " ; do
83+ /enable_location.sh $(( ${i} + 1 )) ${LOCATIONS_ARRAY[$i]}
84+ done
85+ fi
7986
8087if [ " ${NAME_RESOLVER} " == " " ]; then
8188 if [ " ${DNSMASK} " == " TRUE" ]; then
Original file line number Diff line number Diff line change @@ -81,24 +81,7 @@ http {
8181 include /usr/local/openresty/nginx/conf/upload_size*.conf;
8282 include /usr/local/openresty/nginx/conf/nginx_http_extras*.conf;
8383
84- # config to not allow the browser to render the page inside an frame or iframe
85- # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
86- add_header X-Frame-Options SAMEORIGIN;
87-
88- # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
89- # to disable content-type sniffing on some browsers.
90- # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
91- add_header X-Content-Type-Options nosniff;
92-
93- # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
94- # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for
95- # this particular website if it was disabled by the user.
96- # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
97- add_header X-XSS-Protection "1; mode=block" ;
98-
99- # config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
100- # to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
101- add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;" ;
84+ include /usr/local/openresty/nginx/conf/security_defaults.conf;
10285
10386 # Accept underscores in headers as NAXSI does this
10487 underscores_in_headers on;
Original file line number Diff line number Diff line change 1+
2+ # config to not allow the browser to render the page inside an frame or iframe
3+ # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
4+ add_header X-Frame-Options SAMEORIGIN;
5+
6+ # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
7+ # to disable content-type sniffing on some browsers.
8+ # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
9+ add_header X-Content-Type-Options nosniff;
10+
11+ # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
12+ # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for
13+ # this particular website if it was disabled by the user.
14+ # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
15+ add_header X-XSS-Protection "1; mode=block";
16+
17+ # config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
18+ # to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
19+ add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
You can’t perform that action at this time.
0 commit comments