Skip to content

Commit

Permalink
Move nginx-config mount to /usr/local/openresty/nginx/conf.d to avoid…
Browse files Browse the repository at this point in the history
… entrypoint writing to RO mount

Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Sep 18, 2024
1 parent 2704ade commit 9d81055
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion k8s/cloud/base/proxy_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
- name: certs
mountPath: /certs
- name: nginx-config
mountPath: /usr/local/openresty/nginx/conf
mountPath: /usr/local/openresty/nginx/conf.d
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
36 changes: 18 additions & 18 deletions k8s/cloud/base/proxy_nginx_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ data:
etag on;
expires 60m;
add_header Cache-Control "public";
include /usr/local/openresty/nginx/conf/headers_common.conf;
include /usr/local/openresty/nginx/conf.d/headers_common.conf;
pixie_api.conf: |-
location /api/ {
Expand Down Expand Up @@ -232,7 +232,7 @@ data:
ssl_certificate /certs/tls.crt;
ssl_certificate_key /certs/tls.key;
include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;
if ($http_x_forwarded_proto = "http") {
return 404;
Expand All @@ -250,10 +250,10 @@ data:
listen 56000 ssl http2;
server_name @PL_DOMAIN_NAME@ *.cluster.local;
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf/pixie_api.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;
if ($http_x_forwarded_proto = "http") {
return 307 https://$host$request_uri;
Expand All @@ -276,13 +276,13 @@ data:
server_name work.@PL_DOMAIN_NAME@;
error_page 404 = @error404;
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf/pixie_api.conf;
include /usr/local/openresty/nginx/conf/headers_common.conf;
include /usr/local/openresty/nginx/conf/private/*.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;
include /usr/local/openresty/nginx/conf.d/headers_common.conf;
include /usr/local/openresty/nginx/conf.d/private/*.conf;
# Disable caching by default.
add_header Cache-Control "no-store";
Expand Down Expand Up @@ -342,14 +342,14 @@ data:
location ~ ^/static(/.*)$ {
gzip_static off;
root /assets;
include /usr/local/openresty/nginx/conf/pixie_cache.conf;
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
include /usr/local/openresty/nginx/conf.d/pixie_cache.conf;
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
try_files $1 "/index.html";
}
location /auth-complete {
root /assets;
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
try_files $uri "/index.html";
}
Expand All @@ -368,8 +368,8 @@ data:
listen 56000 ssl http2;
server_name segment.@PL_DOMAIN_NAME@;
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
set $segment_cdn "cdn.segment.com";
Expand Down
2 changes: 1 addition & 1 deletion src/cloud/proxy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# SPDX-License-Identifier: Apache-2.0

if [ -n "$PL_DOMAIN_NAME" ]; then
sed -e "s/[@]PL_DOMAIN_NAME[@]/$PL_DOMAIN_NAME/" /usr/local/openresty/nginx/conf/nginx.conf.tmpl > /usr/local/openresty/nginx/conf/nginx.conf
sed -e "s/[@]PL_DOMAIN_NAME[@]/$PL_DOMAIN_NAME/" /usr/local/openresty/nginx/conf.d/nginx.conf.tmpl > /usr/local/openresty/nginx/conf/nginx.conf
else
echo "PL_DOMAIN_NAME undefined, exiting"
exit 1
Expand Down

0 comments on commit 9d81055

Please sign in to comment.