diff --git a/deploy/euler/Dockerfile b/deploy/euler/Dockerfile index eea0e84c3dcbea8064576f452f06ac9bebf0fa42..c724bcdc395a58403e5a539ee609c44008e629b9 100644 --- a/deploy/euler/Dockerfile +++ b/deploy/euler/Dockerfile @@ -8,8 +8,8 @@ RUN pnpm install RUN pnpm build:euler -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder - +FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:latest as NginxBuilder +RUN yum update -y && yum install -y pcre-devel COPY --from=Builder /home/openeuler-datastat/web/dist/openeuler /usr/share/nginx/html/ RUN chmod -R 755 /usr/share/nginx/html diff --git a/deploy/euler/nginx.conf b/deploy/euler/nginx.conf index 25bf31e979017641a94327270265a17f40eb71fe..1901ebf4e9fe30abc6302177c91c546b2ec968cf 100644 --- a/deploy/euler/nginx.conf +++ b/deploy/euler/nginx.conf @@ -26,6 +26,7 @@ http { keepalive_requests 100; proxy_read_timeout 900; proxy_connect_timeout 60; + proxy_hide_header X-Powered-by; proxy_send_timeout 60; client_header_timeout 60; @@ -53,17 +54,26 @@ http { gzip_vary on; server { - # listen 443 ssl; - # server_name localhost; - # charset utf-8; - listen 8080; server_name datastat.openeuler.org; charset utf-8; limit_conn perserver 50; + + add_header X-XSS-Protection "1;mode=block"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options DENY; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma no-cache; + add_header Expires 0; + proxy_set_header X-Forwarded-For $http_x_real_ip; + if ($request_method = 'OPTIONS') { return 401; } + if ($request_method !~ ^(GET|POST)$) { + return 403; + } location / { location /assets { @@ -71,9 +81,6 @@ http { expires 14d; add_header Cache-Control public; } - location / { - add_header Cache-Control no-cache; - } root /usr/share/nginx/html; index index.html; # error_page 404 /404.html; @@ -101,7 +108,7 @@ http { error_page 500 501 502 503 504 505 /500.html; error_page 401 /401.html; - error_page 404 /404.html; + error_page 404 /index.html; location = /401.html { root /usr/share/nginx/html; diff --git a/deploy/gauss/Dockerfile b/deploy/gauss/Dockerfile index 81b0dbec5d69eec0305e6727409dc4b4ef5dd19c..ad9c9faeeef363a5e7043a9f1286aaa108c596fe 100644 --- a/deploy/gauss/Dockerfile +++ b/deploy/gauss/Dockerfile @@ -8,8 +8,8 @@ RUN npm install pnpm -g RUN pnpm install RUN pnpm build:gauss -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder - +FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:latest as NginxBuilder +RUN yum update -y && yum install -y pcre-devel COPY --from=Builder /home/opengauss-datastat/web/dist/opengauss /usr/share/nginx/html/ RUN chmod -R 755 /usr/share/nginx/html diff --git a/deploy/gauss/nginx.conf b/deploy/gauss/nginx.conf index e29181431534228010e477936ae07216d5f21559..291ef5bcf62d92a4fa23a1e99d3f31811ceadcbf 100644 --- a/deploy/gauss/nginx.conf +++ b/deploy/gauss/nginx.conf @@ -26,6 +26,7 @@ http { keepalive_requests 100; proxy_read_timeout 900; proxy_connect_timeout 60; + proxy_hide_header X-Powered-by; proxy_send_timeout 60; client_header_timeout 60; @@ -61,9 +62,23 @@ http { server_name datastat.opengauss.org; charset utf-8; limit_conn perserver 50; + + add_header X-XSS-Protection "1;mode=block"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options DENY; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Content-Seecurity-Policy "default-src 'self'"; + add_header Cache-control "no-cache, no-store, must-revalidate"; + add_header Pragma no-cache; + add_header Expires 0; + proxy_set_header X-Forwarded-For $http_x_real_ip; + if ($request_method = 'OPTIONS') { return 401; } + if ($request_method !~ ^(GET|POST)$) { + return 403; + } location / { location /assets { @@ -71,9 +86,6 @@ http { expires 14d; add_header Cache-Control public; } - location / { - add_header Cache-Control no-cache; - } root /usr/share/nginx/html; index index.html; # error_page 404 /404.html; @@ -101,7 +113,7 @@ http { error_page 500 501 502 503 504 505 /500.html; error_page 401 /401.html; - error_page 404 /404.html; + error_page 404 /index.html; location = /401.html { root /usr/share/nginx/html; diff --git a/deploy/lookeng/Dockerfile b/deploy/lookeng/Dockerfile index 9324ce46b259fb1313184aeb9f413ea4109612e9..090687e131a25f45e25606c07ceb437dca76715b 100644 --- a/deploy/lookeng/Dockerfile +++ b/deploy/lookeng/Dockerfile @@ -8,7 +8,7 @@ RUN pnpm install RUN pnpm build:lookeng -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder +FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:latest as NginxBuilder COPY --from=Builder /home/openlookeng-datastat/web/dist/openlookeng /usr/share/nginx/html/ RUN chmod -R 755 /usr/share/nginx/html diff --git a/deploy/mindspore/Dockerfile b/deploy/mindspore/Dockerfile index 9793d1f7c29b5b500c4cb139affbf1b45244af91..95d7d218fc79212c5b7fdc0c6971057a8354ca36 100644 --- a/deploy/mindspore/Dockerfile +++ b/deploy/mindspore/Dockerfile @@ -8,8 +8,8 @@ RUN pnpm install RUN pnpm build:mindspore -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder - +FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:latest as NginxBuilder +RUN yum update -y && yum install -y pcre-devel COPY --from=Builder /home/mindspore-datastat/web/dist/mindspore /usr/share/nginx/html/ RUN chmod -R 755 /usr/share/nginx/html diff --git a/deploy/mindspore/nginx.conf b/deploy/mindspore/nginx.conf index fd6a8e0e6eb87600912d6d02b10cc6a0cad8ac1c..073057b2d25afc5681a7d074cb24fcd449bb803b 100644 --- a/deploy/mindspore/nginx.conf +++ b/deploy/mindspore/nginx.conf @@ -26,6 +26,7 @@ http { keepalive_requests 100; proxy_read_timeout 900; proxy_connect_timeout 60; + proxy_hide_header X-Powered-by; proxy_send_timeout 60; client_header_timeout 60; @@ -61,9 +62,22 @@ http { server_name datastat.mindspore.cn; charset utf-8; limit_conn perserver 50; + add_header X-XSS-Protection "1;mode=block"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options DENY; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Content-Seecurity-Policy "default-src 'self'"; + add_header Cache-control "no-cache, no-store, must-revalidate"; + add_header Pragma no-cache; + add_header Expires 0; + proxy_set_header X-Forwarded-For $http_x_real_ip; + if ($request_method = 'OPTIONS') { return 401; } + if ($request_method !~ ^(GET|POST)$) { + return 403; + } location / { location /assets { @@ -71,9 +85,6 @@ http { expires 14d; add_header Cache-Control public; } - location / { - add_header Cache-Control no-cache; - } root /usr/share/nginx/html; index index.html; # error_page 404 /404.html; @@ -101,7 +112,7 @@ http { error_page 500 501 502 503 504 505 /500.html; error_page 401 /401.html; - error_page 404 /404.html; + error_page 404 /index.html; location = /401.html { root /usr/share/nginx/html; diff --git a/packages/euler/index.html b/packages/euler/index.html index 9374896e877bf6c531865c150ab0e9438f6559b6..313116c0ce1cab11c750ab3ea397d26ea19621e7 100644 --- a/packages/euler/index.html +++ b/packages/euler/index.html @@ -3,33 +3,37 @@ - + openEuler DATASTAT
-