Skip to content

Commit 4eac0c9

Browse files
authored
Merge pull request #16 from it-at-m/bug/fix-webcomponents-nginx-config
🐛 fix webcomponents nginx config
2 parents 603563b + 87f4f62 commit 4eac0c9

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# For documentation see https://github.com/sclorg/nginx-container
22
FROM registry.access.redhat.com/ubi10/nginx-126:10.0-1747618876@sha256:d1866194c76ee988f6a0777292bbb7421f3bfc7637f43e41e8ad8512ae218cde
33

4-
# Copy built web components
4+
# Copy built web components and SBOM result
55
COPY dist .
66

77
# Copy custom nginx configurations
8-
COPY docker/nginx/*.conf "${NGINX_DEFAULT_CONF_PATH}"
8+
COPY docker/nginx/compression.conf "${NGINX_DEFAULT_CONF_PATH}"
9+
COPY docker/nginx/files.conf "${NGINX_DEFAULT_CONF_PATH}"
10+
COPY docker/nginx/health.conf "${NGINX_DEFAULT_CONF_PATH}"
11+
COPY docker/nginx/sbom.conf "${NGINX_DEFAULT_CONF_PATH}"
912

1013
# Start the web server
1114
CMD ["nginx", "-g", "daemon off;"]

personalization-webcomponents/docker/nginx/files.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
location / {
2-
add_header 'Access-Control-Allow-Origin' $allow_origin;
3-
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
2+
add_header 'Access-Control-Allow-Origin' $http_origin;
3+
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
44

55
location /src/ {
66
expires 365d;
7-
add_header 'Access-Control-Allow-Origin' $allow_origin;
8-
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
7+
add_header 'Access-Control-Allow-Origin' $http_origin;
8+
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
99
add_header Cache-Control "public, no-transform";
1010
}
1111

1212
location ~ ^/loader-.*\.js$ {
13-
add_header 'Access-Control-Allow-Origin' $allow_origin;
13+
add_header 'Access-Control-Allow-Origin' $http_origin;
1414
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
1515
add_header Cache-Control 'no-cache';
1616
}

personalization-webcomponents/docker/nginx/server.conf

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)