Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ server {
set $backend "https://apify.github.io/apify-docs";
resolver 1.1.1.1 8.8.8.8 valid=30s ipv6=off;

# Stale Docusaurus chunks: return 410 instead of 404 for missing /assets/{js,css}/*
# so caches/crawlers drop references to hashed bundles removed by a new deploy.
# Scoped to dedicated locations per backend so the nice Docusaurus 404 page is
# preserved for everything else.
location @gone { return 410; }

location ~ ^/assets/(js/.+\.js|css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass $backend$request_uri;
}

location = / {
if ($serve_markdown) {
rewrite ^ /llms.txt last;
Expand Down Expand Up @@ -63,6 +75,12 @@ server {

### Repository path: "/sdk/js"

location ~ ^/sdk/js/(assets/js/.+\.js|assets/css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass https://apify.github.io/apify-sdk-js/$1;
}

location = /sdk/js {
if ($serve_markdown) {
rewrite ^ /sdk-js-llms.txt last;
Expand Down Expand Up @@ -104,6 +122,12 @@ server {

### Repository path: "/sdk/python"

location ~ ^/sdk/python/(assets/js/.+\.js|assets/css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass https://apify.github.io/apify-sdk-python/$1;
}

location = /sdk/python {
if ($serve_markdown) {
rewrite ^ /sdk-python-llms.txt last;
Expand Down Expand Up @@ -145,6 +169,12 @@ server {

### Repository path: "/api/client/js"

location ~ ^/api/client/js/(assets/js/.+\.js|assets/css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass https://apify.github.io/apify-client-js/$1;
}

location = /api/client/js {
if ($serve_markdown) {
rewrite ^ /client-js-llms.txt last;
Expand Down Expand Up @@ -186,6 +216,12 @@ server {

### Repository path: "/api/client/python"

location ~ ^/api/client/python/(assets/js/.+\.js|assets/css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass https://apify.github.io/apify-client-python/$1;
}

location = /api/client/python {
if ($serve_markdown) {
rewrite ^ /client-python-llms.txt last;
Expand Down Expand Up @@ -227,6 +263,12 @@ server {

### Repository path: "/cli"

location ~ ^/cli/(assets/js/.+\.js|assets/css/.+\.css)$ {
proxy_intercept_errors on;
error_page 404 = @gone;
proxy_pass https://apify.github.io/apify-cli/$1;
}

location = /cli {
if ($serve_markdown) {
rewrite ^ /cli-llms.txt last;
Expand Down
Loading