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
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
include $(pwd)/nginx.conf;
}
EOF
sed -i 's|https://apify.github.io/apify-docs|http://localhost:3000|g' default.conf
mkdir -p $(pwd)/logs
nginx -c $(pwd)/default.conf
sleep 1
Expand Down
15 changes: 10 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ server {
# use 'last' to force a new location lookup so /__proxy/ handler runs
rewrite ^ /__proxy/llms.txt last;
}
proxy_pass http://localhost:3000;
proxy_pass https://apify.github.io/apify-docs/;
}

# direct llms.txt files, serve with markdown content type
location ~ ^/llms(-full)?\.txt$ {
proxy_pass http://localhost:3000;
location /llms.txt {
proxy_pass https://apify.github.io/apify-docs/llms.txt;
proxy_hide_header Content-Type;
add_header Content-Type "text/markdown; charset=utf-8" always;
}
location /llms-full.txt {
proxy_pass https://apify.github.io/apify-docs/llms-full.txt;
proxy_hide_header Content-Type;
add_header Content-Type "text/markdown; charset=utf-8" always;
}
Expand All @@ -30,7 +35,7 @@ server {
# rewrite to internal proxy path; use last so new location is matched
rewrite ^(/[^.]+)$ /__proxy$1.md last;
}
proxy_pass http://localhost:3000;
proxy_pass https://apify.github.io/apify-docs/;
}

# internal proxy handler that actually forces the markdown header
Expand All @@ -40,7 +45,7 @@ server {
# strip the /__proxy prefix so upstream sees the real path
rewrite ^/__proxy(/.*)$ $1 break;

proxy_pass http://localhost:3000;
proxy_pass https://apify.github.io/apify-docs/;
proxy_hide_header Content-Type;
add_header Content-Type "text/markdown; charset=utf-8" always;
}
Expand Down
Loading