Skip to content

Commit e235d84

Browse files
committed
fix: use production URL for proxy pass
Related: #1997
1 parent a712db3 commit e235d84

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
include $(pwd)/nginx.conf;
5959
}
6060
EOF
61+
sed -i 's|https://apify.github.io/apify-docs/|http://localhost:3000|g' default.conf
6162
mkdir -p $(pwd)/logs
6263
nginx -c $(pwd)/default.conf
6364
sleep 1

nginx.conf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)