v7
This commit is contained in:
@@ -34,7 +34,9 @@ class _AiChatState extends State<AiChat> {
|
|||||||
final client = ollama.OllamaClient(
|
final client = ollama.OllamaClient(
|
||||||
baseUrl: "${AppEnviroment.baseAiUrl}/api",
|
baseUrl: "${AppEnviroment.baseAiUrl}/api",
|
||||||
headers: {
|
headers: {
|
||||||
"Access-Control-Allow-Origin": "https://app.mzansi-innovation-hub.co.za",
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Access-Control-Allow-Methods": "POST, GET, OPTIONS",
|
||||||
|
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
List<ollama.Message> _chatHistory = [];
|
List<ollama.Message> _chatHistory = [];
|
||||||
|
|||||||
@@ -155,23 +155,23 @@ http {
|
|||||||
|
|
||||||
# Web Api
|
# Web Api
|
||||||
location / {
|
location / {
|
||||||
# # Handle preflight OPTIONS requests
|
# Handle preflight OPTIONS requests
|
||||||
# if ($request_method = OPTIONS ) {
|
if ($request_method = OPTIONS ) {
|
||||||
# # Add CORS headers for preflight request
|
# Add CORS headers for preflight request
|
||||||
# add_header 'Access-Control-Allow-Origin' 'https://app.mzansi-innovation-hub.co.za' always;
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||||
# add_header 'Access-Control-Allow-Credentials' 'true' always;
|
# add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
||||||
# add_header 'Access-Control-Max-Age' 1728000;
|
add_header 'Access-Control-Max-Age' 1728000;
|
||||||
# return 204;
|
return 204;
|
||||||
# }
|
}
|
||||||
|
|
||||||
# add_header 'Access-Control-Allow-Origin' 'https://app.mzansi-innovation-hub.co.za' always;
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||||
# add_header 'Access-Control-Allow-Credentials' 'true' always;
|
# add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
||||||
|
|
||||||
proxy_pass http://MIH-AI:11434/;
|
proxy_pass http://MIH-AI:11434/;
|
||||||
# proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /.well-known/acme-challenge/ {
|
location ~ /.well-known/acme-challenge/ {
|
||||||
|
|||||||
Reference in New Issue
Block a user