1+ map $DOCS_PROXY_TARGET $proxy_target {
2+ default "https://apify.github.io/apify-docs/" ;
3+ "" "https://apify.github.io/apify-docs/" ;
4+ "~^http" $DOCS_PROXY_TARGET ;
5+ }
16map $http_accept $wants_markdown {
27 default 0;
38 "~*text/markdown" 1;
@@ -14,12 +19,12 @@ server {
1419 # use 'last' to force a new location lookup so /__proxy/ handler runs
1520 rewrite ^ /__proxy/llms.txt last;
1621 }
17- proxy_pass http ://localhost: 3000 ;
22+ proxy_pass $DOCS_PROXY_TARGET ;
1823 }
1924
2025 # direct llms.txt files, serve with markdown content type
2126 location ~ ^/llms( -full) ?\.txt$ {
22- proxy_pass http ://localhost: 3000 ;
27+ proxy_pass $DOCS_PROXY_TARGET ;
2328 proxy_hide_header Content-Type;
2429 add_header Content-Type "text/markdown; charset=utf-8" always;
2530 }
@@ -30,7 +35,7 @@ server {
3035 # rewrite to internal proxy path; use last so new location is matched
3136 rewrite ^( /[^.]+) $ /__proxy$1 .md last;
3237 }
33- proxy_pass http ://localhost: 3000 ;
38+ proxy_pass $DOCS_PROXY_TARGET ;
3439 }
3540
3641 # internal proxy handler that actually forces the markdown header
@@ -40,7 +45,7 @@ server {
4045 # strip the /__proxy prefix so upstream sees the real path
4146 rewrite ^/__proxy( /.*) $ $1 break ;
4247
43- proxy_pass http ://localhost: 3000 ;
48+ proxy_pass $DOCS_PROXY_TARGET ;
4449 proxy_hide_header Content-Type;
4550 add_header Content-Type "text/markdown; charset=utf-8" always;
4651 }
0 commit comments