1+ env DOCS_PROXY_TARGET;
2+
3+ map $DOCS_PROXY_TARGET $proxy_target {
4+ default "https://apify.github.io/apify-docs/" ;
5+ "" "https://apify.github.io/apify-docs/" ;
6+ "~^http" $DOCS_PROXY_TARGET ;
7+ }
18map $http_accept $wants_markdown {
29 default 0;
310 "~*text/markdown" 1;
@@ -14,12 +21,12 @@ server {
1421 # use 'last' to force a new location lookup so /__proxy/ handler runs
1522 rewrite ^ /__proxy/llms.txt last;
1623 }
17- proxy_pass http ://localhost: 3000 ;
24+ proxy_pass $DOCS_PROXY_TARGET ;
1825 }
1926
2027 # direct llms.txt files, serve with markdown content type
2128 location ~ ^/llms( -full) ?\.txt$ {
22- proxy_pass http ://localhost: 3000 ;
29+ proxy_pass $DOCS_PROXY_TARGET ;
2330 proxy_hide_header Content-Type;
2431 add_header Content-Type "text/markdown; charset=utf-8" always;
2532 }
@@ -30,7 +37,7 @@ server {
3037 # rewrite to internal proxy path; use last so new location is matched
3138 rewrite ^( /[^.]+) $ /__proxy$1 .md last;
3239 }
33- proxy_pass http ://localhost: 3000 ;
40+ proxy_pass $DOCS_PROXY_TARGET ;
3441 }
3542
3643 # internal proxy handler that actually forces the markdown header
@@ -40,7 +47,7 @@ server {
4047 # strip the /__proxy prefix so upstream sees the real path
4148 rewrite ^/__proxy( /.*) $ $1 break ;
4249
43- proxy_pass http ://localhost: 3000 ;
50+ proxy_pass $DOCS_PROXY_TARGET ;
4451 proxy_hide_header Content-Type;
4552 add_header Content-Type "text/markdown; charset=utf-8" always;
4653 }
0 commit comments