Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 0 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,44 +89,34 @@ jobs:
assert_header "http://localhost:8080/llms-full.txt" "Content-Type" "text/markdown"

echo "🧪 Checking Nginx responses... (apify-sdk-js)"
assert_header "http://localhost:8080/sdk/js" "Content-Type" "text/html"
assert_header "http://localhost:8080/sdk/js" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform" "Content-Type" "text/html"
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/sdk/js/docs/guides/apify-platform" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/sdk/js/llms.txt" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/sdk/js/llms-full.txt" "Content-Type" "text/markdown"

echo "🧪 Checking Nginx responses... (apify-sdk-python)"
assert_header "http://localhost:8080/sdk/python" "Content-Type" "text/html"
assert_header "http://localhost:8080/sdk/python" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/sdk/python/docs/changelog" "Content-Type" "text/html"
assert_header "http://localhost:8080/sdk/python/docs/changelog.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/sdk/python/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/sdk/python/llms.txt" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/sdk/python/llms-full.txt" "Content-Type" "text/markdown"

echo "🧪 Checking Nginx responses... (apify-client-js)"
assert_header "http://localhost:8080/api/client/js" "Content-Type" "text/html"
assert_header "http://localhost:8080/api/client/js" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/api/client/js/docs/changelog" "Content-Type" "text/html"
assert_header "http://localhost:8080/api/client/js/docs/changelog.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/api/client/js/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/api/client/js/llms.txt" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/api/client/js/llms-full.txt" "Content-Type" "text/markdown"

echo "🧪 Checking Nginx responses... (apify-client-python)"
assert_header "http://localhost:8080/api/client/python" "Content-Type" "text/html"
assert_header "http://localhost:8080/api/client/python" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/api/client/python/docs/changelog" "Content-Type" "text/html"
assert_header "http://localhost:8080/api/client/python/docs/changelog.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/api/client/python/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/api/client/python/llms.txt" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/api/client/python/llms-full.txt" "Content-Type" "text/markdown"

echo "🧪 Checking Nginx responses... (apify-cli)"
assert_header "http://localhost:8080/cli" "Content-Type" "text/html"
assert_header "http://localhost:8080/cli" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/cli/docs/changelog" "Content-Type" "text/html"
assert_header "http://localhost:8080/cli/docs/changelog.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/cli/docs/changelog" "Content-Type" "text/markdown" -H "Accept: text/markdown"
Expand Down
12 changes: 6 additions & 6 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ server {
rewrite ^/apify-client-js/latest/?$ /api/client/js redirect;
rewrite ^/apify-client-python/?$ /api/client/python redirect;

# remove trailing slashes from the root of GH pages docs
rewrite ^/api/client/js/$ /api/client/js redirect;
rewrite ^/api/client/python/$ /api/client/python redirect;
rewrite ^/sdk/js/$ /sdk/js redirect;
rewrite ^/sdk/python/$ /sdk/python redirect;
rewrite ^/cli/$ /cli redirect;
# Landing page removal redirects - redirect root paths to docs pages
rewrite ^/api/client/js/?$ /api/client/js/docs permanent;
rewrite ^/api/client/python/?$ /api/client/python/docs/overview permanent;
rewrite ^/sdk/js/?$ /sdk/js/docs/overview permanent;
rewrite ^/sdk/python/?$ /sdk/python/docs/overview permanent;
rewrite ^/cli/?$ /cli/docs permanent;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite rules break LLM markdown serving for root paths

Medium Severity

The new rewrite rules with permanent flag execute during nginx's rewrite phase before location matching. This means requests to /sdk/js, /sdk/python, /api/client/js, /api/client/python, and /cli will receive 301 redirects before the location = blocks can check $serve_markdown and serve llms.txt content. LLM clients requesting markdown content at these root paths will be redirected to docs pages instead of receiving the expected LLM text files.

Fix in Cursor Fix in Web


# versions page redirects
rewrite ^/versions/?$ / permanent; # no docs-wide changelog, redirect to the root
Expand Down