diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index e66929d36628c201692618b94e6a1629111b143e..80ce476a36b260ba56f8f4bca7a8f2ccf280295f 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -111,7 +111,7 @@ http { proxy_pass https://openeuler-website-docs-zh.openeuler-website-docs:8080/zh/docs/24.03_LTS_SP1/; } - include ./confd/nginx*.conf; + # include ./confd/nginx*.conf; error_page 401 402 403 405 406 407 413 414 /error.html; error_page 500 501 502 503 504 505 /error.html; @@ -128,5 +128,53 @@ http { location = /zh/ { return 301 /zh/index.html; } + + # 搜索 + location ^~ /api-search/ { + 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 "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; + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_ssl_protocols TLSv1.2 TLSv1.3; + proxy_pass https://doc-search.test.osinfra.cn/; + } + + # 登录 + location ^~ /api-id/ { + 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 Strict-Transport-Security "max-age=31536000; includeSubDomains"; + 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; + + proxy_pass https://omapi.test.osinfra.cn/; + } + + # datastat数据 + location /api-dsapi/ { + 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; + + proxy_pass https://dsapi.test.osinfra.cn/; + # proxy_pass https://dsapi.osinfra.cn/; + } } } \ No newline at end of file