Skip to content

Commit 8cd52e7

Browse files
committed
fix default of npmplus_upstream_compression/npmplus_x_frame_options in custom locations
1 parent 04b3c36 commit 8cd52e7

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

backend/templates/_proxy_host_custom_location.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ location {{ location_type }}{{ path }} {
1212
{% if npmplus_noindex == true %}include noindex-nofollow.conf;{% endif %}
1313
{% if npmplus_crowdsec_appsec == true %}set $crowdsec_disable_appsec 1;{% endif %}
1414

15-
{% if npmplus_x_frame_options == "DENY" or npmplus_x_frame_options == "SAMEORIGIN" %}
16-
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
17-
{% elsif npmplus_x_frame_options == "none" %}
15+
{% if npmplus_x_frame_options == "none" %}
1816
more_clear_headers "X-Frame-Options";
17+
{% elsif npmplus_x_frame_options == "upstream" %}{% else %}
18+
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
1919
{% endif %}
2020

2121
{% if forward_scheme == "http" or forward_scheme == "https" %}
2222

2323
set $upstream {{ forward_host }};
2424
include proxy-headers.conf;
25-
{% if npmplus_upstream_compression == false %}proxy_set_header Accept-Encoding "";{% endif %}
25+
{% if npmplus_upstream_compression != true %}proxy_set_header Accept-Encoding "";{% endif %}
2626
{% if npmplus_proxy_request_buffering == true %}proxy_request_buffering off;{% endif %}
2727
{% if npmplus_proxy_response_buffering == true %}proxy_buffering off;{% endif %}
2828
proxy_pass {{ forward_scheme }}://{% if forward_path != null %}{{ forward_host }}{% else %}$upstream{% endif %}{% if forward_port != null %}:{{ forward_port }}{% endif %}{% if forward_path != null %}{{ forward_path }}{% else %}$request_uri{% endif %};
@@ -31,7 +31,7 @@ location {{ location_type }}{{ path }} {
3131

3232
set $upstream {{ forward_host }};
3333
include grpc-headers.conf;
34-
{% if npmplus_upstream_compression == false %}grpc_set_header Accept-Encoding "";{% endif %}
34+
{% if npmplus_upstream_compression != true %}grpc_set_header Accept-Encoding "";{% endif %}
3535
grpc_pass {{ forward_scheme }}://{% if forward_path != null %}{{ forward_host }}{% else %}$upstream{% endif %}{% if forward_port != null %}:{{ forward_port }}{% endif %}{% if forward_path != null %}{{ forward_path }}{% else %}$request_uri{% endif %};
3636

3737
{% elsif forward_scheme == "path" %}

backend/templates/proxy_host.conf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535
{% if npmplus_noindex == true %}include noindex-nofollow.conf;{% endif %}
3636
{% if npmplus_crowdsec_appsec == true %}set $crowdsec_disable_appsec 1;{% endif %}
3737

38-
{% if npmplus_x_frame_options == "DENY" or npmplus_x_frame_options == "SAMEORIGIN" %}
39-
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
40-
{% elsif npmplus_x_frame_options == "none" %}
41-
more_clear_headers "X-Frame-Options";
42-
{% endif %}
38+
{% if npmplus_x_frame_options == "none" %}
39+
more_clear_headers "X-Frame-Options";
40+
{% elsif npmplus_x_frame_options == "upstream" %}{% else %}
41+
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
42+
{% endif %}
4343

4444
{% if forward_scheme == "http" or forward_scheme == "https" %}
4545

4646
set $upstream {{ forward_host }};
4747
include proxy-headers.conf;
48-
{% if npmplus_upstream_compression == false %}proxy_set_header Accept-Encoding "";{% endif %}
48+
{% if npmplus_upstream_compression != true %}proxy_set_header Accept-Encoding "";{% endif %}
4949
{% if npmplus_proxy_request_buffering == true %}proxy_request_buffering off;{% endif %}
5050
{% if npmplus_proxy_response_buffering == true %}proxy_buffering off;{% endif %}
5151
proxy_pass {{ forward_scheme }}://{% if forward_path != null %}{{ forward_host }}{% else %}$upstream{% endif %}{% if forward_port != null %}:{{ forward_port }}{% endif %}{% if forward_path != null %}{{ forward_path }}{% else %}$request_uri{% endif %};
@@ -54,7 +54,7 @@
5454

5555
set $upstream {{ forward_host }};
5656
include grpc-headers.conf;
57-
{% if npmplus_upstream_compression == false %}grpc_set_header Accept-Encoding "";{% endif %}
57+
{% if npmplus_upstream_compression != true %}grpc_set_header Accept-Encoding "";{% endif %}
5858
grpc_pass {{ forward_scheme }}://{% if forward_path != null %}{{ forward_host }}{% else %}$upstream{% endif %}{% if forward_port != null %}:{{ forward_port }}{% endif %}{% if forward_path != null %}{{ forward_path }}{% else %}$request_uri{% endif %};
5959

6060
{% elsif forward_scheme == "path" %}

rootfs/usr/local/bin/envs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ if [ "$GOA" = "true" ] && [ "$LOGROTATE" = "false" ]; then
726726
fi
727727

728728

729-
export TV="10"
729+
export TV="11"
730730
if [ ! -s /data/npmplus/env.sha512sum ] || [ "$(cat /data/npmplus/env.sha512sum)" != "$( (grep "env\.[A-Z0-9_]\+" -roh /app/templates | sed "s|env.||g" | sort | uniq | xargs printenv; echo "$TV") | tr -d "\n" | sha512sum | cut -d" " -f1)" ]; then
731731
echo "At least one env or the template version changed, all hosts will be regenerated. Please make sure to read the changelog."
732732
export REGENERATE_ALL="true"

0 commit comments

Comments
 (0)