Skip to content

Commit af175f2

Browse files
Merge pull request #250 from firecrawl/noaa/oauth-nginx-config
2 parents f7f87e9 + 8342d00 commit af175f2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docker/nginx.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ http {
66
server {
77
listen 8080;
88

9+
# OAuth discovery documents (RFC 8414 / RFC 9728) must reach the app with the
10+
# URI intact. `^~` makes this prefix win over the legacy /{apiKey}/{rest} regex
11+
# below, which would otherwise treat ".well-known" as an API key and rewrite the
12+
# path to /oauth-protected-resource (404). This is what the 401 challenge's
13+
# `resource_metadata` URL points at, so it MUST resolve.
14+
location ^~ /.well-known/ {
15+
proxy_buffering off;
16+
proxy_read_timeout 30s;
17+
proxy_send_timeout 30s;
18+
proxy_set_header Host $host;
19+
proxy_set_header X-Forwarded-For $remote_addr;
20+
proxy_set_header X-Forwarded-Proto $scheme;
21+
proxy_pass http://app;
22+
}
23+
924
# Header-based with version: /v1|v2/{rest} (MUST COME BEFORE LEGACY)
1025
location ~ ^/v(?:1|2)/(.*)$ {
1126
proxy_buffering off;

0 commit comments

Comments
 (0)