## Server Block for docs-archive.pingcap.com behind the Ucloud ULB map $sent_http_content_type $expires { default off; text/html epoch; application/json epoch; text/css max; application/javascript max; image/* max; } map $sent_http_content_type $cache { default off; text/html off; application/json off; text/css "public, immutable"; application/javascript "public, immutable"; image/* "public, immutable"; } server { listen 80; server_name docs-archive.pingcap.com; root /var/www/docs-archive.pingcap.com; index index.html index.htm; access_log /var/log/nginx/docs-archive.pingcap.com.log main; error_log /var/log/nginx/docs-archive.pingcap.com.err error; ## Ucloud redirect if ($http_x_forwarded_proto = "http") { return 301 https://$server_name$request_uri; } absolute_redirect off; expires $expires; add_header Cache-Control $cache; error_page 404 403 /404.html; location = /zh/tools/ { return 302 https://$server_name/zh/tidb/stable/ecosystem-tool-user-guide/; } location = /zh/dev-guide/ { return 302 https://$server_name/zh/dev-guide/dev/; } location = /zh/tidb/ { return 302 https://$server_name/zh/tidb/stable/; } ## EN Port location = /tidb/ { return 302 https://$server_name/tidb/stable/; } location = /tools/ { return 302 https://$server_name/tidb/stable/ecosystem-tool-user-guide/; } # Do remember to update after stable branch changed. # vvv location = /zh/tidb/v6.5 { return 302 https://$server_name/zh/tidb/stable; } location ~ ^/zh/tidb/v6.5/(.*) { return 302 https://$server_name/zh/tidb/stable/$1; } location = /tidb/v6.5 { return 302 https://$server_name/tidb/stable; } location ~ ^/tidb/v6.5/(.*) { return 302 https://$server_name/tidb/stable/$1; } # ^^^ location = /ja/tidb/v2.1 { return 301 https://docs-archive.pingcap.com/tidb/v2.1; } location ~ ^/ja/tidb/v2.1/(.*) { return 301 https://docs-archive.pingcap.com/tidb/v2.1/$1; } location = /tidb-in-kubernetes/ { return 302 https://$server_name/tidb-in-kubernetes/stable/; } location /tidb-in-kubernetes/v1.3 { alias /var/www/docs-archive.pingcap.com/tidb-in-kubernetes/stable; } location = /zh/tidb-in-kubernetes/ { return 302 https://$server_name/zh/tidb-in-kubernetes/stable/; } location = /zh/tidb-in-kubernetes/v1.3 { return 302 https://$server_name/zh/tidb-in-kubernetes/stable/; } location ~ ^/zh/tidb-in-kubernetes/v1.3/(.*) { return 302 https://$server_name/zh/tidb-in-kubernetes/stable/$1; } location /tidb-data-migration/stable { return 301 https://$server_name/tidb/stable/dm-overview; } location /zh/tidb-data-migration/stable { return 301 https://$server_name/zh/tidb/stable/dm-overview; } location /zh/appdev/dev { return 301 https://$server_name/zh/tidb/stable/dev-guide-overview; } location ~ ^/tidbcloud/beta/(.*) { return 302 https://$server_name/tidbcloud/$1; } location ~ ^/tidbcloud/public-preview/(.*) { location ~ ^/tidbcloud/public-preview/(service-level-agreement|terms-of-service|privacy-policy) { return 302 https://en.pingcap.com/legal/; } return 302 https://$server_name/tidbcloud/$1; } location /zh/tidb-data-migration/dev/ { return 302 https://$server_name/zh/tidb/dev/dm-overview; } location /tidb-data-migration/dev/ { return 302 https://$server_name/tidb/dev/dm-overview; } }