Skip to content

Commit

Permalink
fixed few issues with upload files and ngnix
Browse files Browse the repository at this point in the history
  • Loading branch information
Formartha committed Mar 6, 2024
1 parent 3e5b164 commit ee84048
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ai1899/api_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,15 @@ async def upsert_collection():
---
tags:
- AI
consumes:
- multipart/form-data
parameters:
- name: file
in: formData
required: true
type: file
- name: collection
required: true
in: formData
type: string
content:
multipart/form-data:
schema:
Expand All @@ -273,12 +274,12 @@ async def upsert_collection():
in: formData
description: The JSON file to be uploaded
collection:
type: string
in: formData
type: formData
description: The name of the collection
responses:
200:
description: Returns task ID
"""
try:
# Check if a file is present in the request
Expand Down
23 changes: 23 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ http {
proxy_pass http://ai:5555/;
}

location /apidocs/ {
proxy_pass http://ai:5555/apidocs/;
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;
}

location /flasgger_static/ {
proxy_pass http://ai:5555/flasgger_static/;
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;
}

location /apispec_1.json {
proxy_pass http://ai:5555/apispec_1.json;
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;
}
location /qdrant/ {
rewrite ^/qdrant/(.*) /$1 break;
proxy_pass http://qdrant-container:6333/;
Expand Down

0 comments on commit ee84048

Please sign in to comment.