From cd524d6912a53a1a9479610ef9180f3f1a3cb0a7 Mon Sep 17 00:00:00 2001 From: swve Date: Mon, 10 Jun 2024 14:37:40 +0100 Subject: [PATCH] fix: adapt oauth updates to self hosting --- extra/example-learnhouse-conf.env | 6 +++++- extra/nginx.conf | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/extra/example-learnhouse-conf.env b/extra/example-learnhouse-conf.env index a27af8c1..65aea3a3 100644 --- a/extra/example-learnhouse-conf.env +++ b/extra/example-learnhouse-conf.env @@ -1,7 +1,11 @@ # Frontend NEXT_PUBLIC_LEARNHOUSE_MULTI_ORG=false NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORG=default +NEXT_PUBLIC_LEARNHOUSE_TOP_DOMAIN=localhost +NEXTAUTH_SECRET=changeme +NEXTAUTH_URL=http://localhost # Backend LEARNHOUSE_COOKIE_DOMAIN=.localhost LEARNHOUSE_SQL_CONNECTION_STRING=postgresql://learnhouse:learnhouse@db:5432/learnhouse -LEARNHOUSE_REDIS_CONNECTION_STRING=redis://redis:6379/learnhouse \ No newline at end of file +LEARNHOUSE_REDIS_CONNECTION_STRING=redis://redis:6379/learnhouse +LEARNHOUSE_CHROMADB_HOST=chromadb \ No newline at end of file diff --git a/extra/nginx.conf b/extra/nginx.conf index 67593660..454ec059 100644 --- a/extra/nginx.conf +++ b/extra/nginx.conf @@ -1,6 +1,7 @@ server { listen 80; server_name localhost; + client_max_body_size 500M; # NextJS Revalidation location /api/revalidate { @@ -11,8 +12,17 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } + # Next Auth + location /api/auth { + proxy_pass http://localhost:8000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + # Python Backend API - location /api { + location /api/v1 { proxy_pass http://localhost:9000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;