问题反馈
From 18a80316277cc280d22bfe9d22b7a94da37e1423 Mon Sep 17 00:00:00 2001 From: 10086 <845831435@qq.com> Date: Wed, 19 Feb 2025 18:32:50 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E9=82=AE=E7=AE=B1=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: nginx 缓存策略更新 updata dockerfile docker --- Dockerfile | 5 +++- config.toml | 2 +- deploy/nginx.conf | 42 ++++++++++++++++++++++++++----- layouts/partials/float-popup.html | 4 +-- layouts/partials/float.html | 2 +- layouts/partials/pcfooter.html | 33 ++---------------------- 6 files changed, 46 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb9a9f735..b0e3f3507 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx-hugo:1.24.0-22.03-lts-sp1-0.121.1 +FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx-hugo:latest + +RUN yum update -y \ + && yum install -y pcre-devel RUN git config --global http.postBuffer 1048576000 && \ git config --global https.postBuffer 1048576000 diff --git a/config.toml b/config.toml index 4e8b0ce43..f02a40a72 100644 --- a/config.toml +++ b/config.toml @@ -136,7 +136,7 @@ paginate = 10 defaultKeywords = ["devows", "hugo", "go", "openGauss"] author = "Site template made by devcows Modified by openGauss team" defaultDescription = "Select the version and chapter of the openGauss documentation you want to view." - email = "contact@opengauss.org" + email = "contact@public.opengauss.org" ### DOC Configurations BookRepo = 'https://gitee.com/opengauss/docs/tree/website-v2/' diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 056bfbf4c..8a9f28535 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -66,13 +66,34 @@ http { server_name localhost; charset utf-8; limit_conn perserver 50; - if ($request_method = 'OPTIONS') { - return 401; + + if ($request_method !~ ^(GET|HEAD|POST)$) { + return 444; } + location / { - root /usr/share/nginx/html; - index index.html index.htm; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Content-Security-Policy "script-src 'self' https://hm.baidu.com https://unpkg.com/@opensig/ 'unsafe-inline' 'unsafe-eval'; object-src 'none'; frame-src 'none'"; + add_header Cache-Control "no-cache,no-store,must-revalidate"; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Pragma no-cache; + add_header Expires 0; + + location ~* ^/(css|js|img)(/|$) { + add_header X-XSS-Protection "1; mode=block"; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; frame-src 'none'"; + add_header Cache-Control "public,max-age=1209600"; + expires 14d; + } + + root /usr/share/nginx/html; + index index.html index.htm; } error_page 404 /zh/404.html; @@ -81,12 +102,21 @@ http { root /usr/share/nginx/html; } - location /api-search/ { + location /api-search/ { proxy_pass https://doc-search-opengauss.osinfra.cn/; } - location /api-dsapi/ { + location /api-dsapi/ { proxy_pass https://dsapi.osinfra.cn/; + + proxy_set_header X-Forwarded-For $http_x_real_ip; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; + add_header Cache-Control "no-cache,no-store,must-revalidate"; + add_header Pragma no-cache; + add_header Expires 0; } location ~ /\. { diff --git a/layouts/partials/float-popup.html b/layouts/partials/float-popup.html index ce3f88f9b..a17e9db37 100644 --- a/layouts/partials/float-popup.html +++ b/layouts/partials/float-popup.html @@ -26,8 +26,8 @@
感谢您的反馈,如需帮助可联系contact@opengauss.org + href="mailto:contact@public.opengauss.org" + >contact@public.opengauss.org
{{i18n "copy_right"}}