From 440237083b84dcf9514710ec46c8fbc465b24837 Mon Sep 17 00:00:00 2001 From: Alex Graf Date: Sat, 24 Feb 2024 10:26:36 +0100 Subject: [PATCH] update pre-release action --- apps/client-asset-sg/docker/Dockerfile | 2 +- apps/client-asset-sg/docker/nginx.conf | 46 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 apps/client-asset-sg/docker/nginx.conf diff --git a/apps/client-asset-sg/docker/Dockerfile b/apps/client-asset-sg/docker/Dockerfile index ccc9ae4e..6e868c32 100644 --- a/apps/client-asset-sg/docker/Dockerfile +++ b/apps/client-asset-sg/docker/Dockerfile @@ -18,7 +18,7 @@ COPY --from=ui-builder /app/dist/apps/client-asset-sg . # this nginx base image will parse the template and will move it to # /etc/nginx/conf.d/default.conf before it starts nginx process -COPY container/nginx.conf /etc/nginx/templates/default.conf.template +COPY /apps/client-asset-sg/docker/nginx.conf /etc/nginx/templates/default.conf.template HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD wget localhost -q -O - > /dev/null 2>&1 diff --git a/apps/client-asset-sg/docker/nginx.conf b/apps/client-asset-sg/docker/nginx.conf new file mode 100644 index 00000000..4dfd0784 --- /dev/null +++ b/apps/client-asset-sg/docker/nginx.conf @@ -0,0 +1,46 @@ +map $sent_http_content_type $expires { + default off; + text/html epoch; # means no cache, as it is not a static page + text/css max; + application/javascript max; + application/woff2 max; + application/octet-stream max; + image/svg+xml 30d; + application/wasm max; +} + +gzip on; + +gzip_vary on; +gzip_proxied any; +gzip_comp_level 6; +gzip_buffers 16 8k; +gzip_min_length 256; +gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; + +server { + listen 80; + listen [::]:80; + + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + add_header 'Access-Control-Allow-Origin' '$http_origin'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,User-Agent,User-Identifier,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; + add_header 'Timing-Allow-Origin' '*'; + + root /usr/share/nginx/html; + + location /robots.txt { + return 200 "User-agent: *\nDisallow: /\n"; + } + + location ~ /\. { + deny all; + } + + location / { + expires $expires; + try_files $uri$args $uri$args/ /index.html; + } +}