@@ -8,18 +8,21 @@ server {
88 listen 0.0.0.0:8080 ;
99 server_name 'docs.apify.com' ;
1010
11+ # Default production upstream
12+ set $proxy_target https://apify.github.io/apify-docs/;
13+
1114 # homepage: only rewrite to internal proxy when client wants markdown
1215 location = / {
1316 if ( $wants_markdown ) {
1417 # use 'last' to force a new location lookup so /__proxy/ handler runs
1518 rewrite ^ /__proxy/llms.txt last;
1619 }
17- proxy_pass http ://localhost: 3000 ;
20+ proxy_pass $proxy_target ;
1821 }
1922
2023 # direct llms.txt files, serve with markdown content type
2124 location ~ ^/llms( -full) ?\.txt$ {
22- proxy_pass http ://localhost: 3000 ;
25+ proxy_pass $proxy_target ;
2326 proxy_hide_header Content-Type;
2427 add_header Content-Type "text/markdown; charset=utf-8" always;
2528 }
@@ -30,7 +33,7 @@ server {
3033 # rewrite to internal proxy path; use last so new location is matched
3134 rewrite ^( /[^.]+) $ /__proxy$1 .md last;
3235 }
33- proxy_pass http ://localhost: 3000 ;
36+ proxy_pass $proxy_target ;
3437 }
3538
3639 # internal proxy handler that actually forces the markdown header
@@ -40,7 +43,7 @@ server {
4043 # strip the /__proxy prefix so upstream sees the real path
4144 rewrite ^/__proxy( /.*) $ $1 break ;
4245
43- proxy_pass http ://localhost: 3000 ;
46+ proxy_pass $proxy_target ;
4447 proxy_hide_header Content-Type;
4548 add_header Content-Type "text/markdown; charset=utf-8" always;
4649 }
0 commit comments