Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ services:
context: .
dockerfile: ./embedder_service/Dockerfile
container_name: embedder_service
ports:
- "8005:8000"
env_file:
- ./embedder_service/.env
depends_on:
Expand All @@ -48,6 +46,7 @@ services:
- pdf_extraction_service
- pdf_processor_service
- chat_service
- embedder_service

redis:
container_name: redis
Expand Down
5 changes: 1 addition & 4 deletions embedder_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
)

app = FastAPI()
app = FastAPI(root_path="/embedder")

# /Health endpoint
app.include_router(health.router)
# /Embed endpoint
# /Status/{doc_id} endpoint
app.include_router(embed.router)
1 change: 1 addition & 0 deletions nginx/example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PDF_PROCESSOR_URL=http://pdf_processor_service:8000
PDF_EXTRACTOR_URL=http://pdf_extraction_service:8000
CHAT_URL=http://chat_service:8000
EMBEDDER_URL=http://embedder_service:8000
4 changes: 4 additions & 0 deletions nginx/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ server {
location /chat/ {
proxy_pass ${CHAT_URL}/;
}

location /embedder/ {
proxy_pass ${EMBEDDER_URL}/;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's a good practice to forward headers from the proxy to the upstream service. This allows the application to have context about the original request, such as the client's IP address. This is crucial for logging, security, and general debugging.

I recommend adding standard proxy headers like X-Forwarded-For, X-Forwarded-Proto, X-Real-IP, and Host.

For consistency, you might consider applying this to the other location blocks in this file as well.

        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;
        proxy_pass ${EMBEDDER_URL}/;

}
}