From 631725c0f9f98d102f9432657be2b64e9bdadc0e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 28 Jan 2024 19:14:12 +0100 Subject: [PATCH] Redirect meilisearch to container --- .docker/nginx/nginx.conf | 11 +++++++++++ resources/js/composables/useSearch.js | 2 +- resources/views/app.blade.php | 1 - 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.docker/nginx/nginx.conf b/.docker/nginx/nginx.conf index 27b284da..6a4d9b30 100644 --- a/.docker/nginx/nginx.conf +++ b/.docker/nginx/nginx.conf @@ -36,6 +36,17 @@ http { proxy_read_timeout 60; proxy_connect_timeout 60; } + location /indexes/members/search { + proxy_pass http://meilisearch:7700/indexes/members/search; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + proxy_read_timeout 60; + proxy_connect_timeout 60; + } location / { try_files $uri $uri/ /index.php?$query_string; } diff --git a/resources/js/composables/useSearch.js b/resources/js/composables/useSearch.js index be592c29..6fdf4f14 100644 --- a/resources/js/composables/useSearch.js +++ b/resources/js/composables/useSearch.js @@ -4,7 +4,7 @@ export default function useSearch() { const axios = inject('axios'); async function search(text, filters = []) { var response = await axios.post( - document.querySelector('meta[name="meilisearch_baseurl"]').content + '/indexes/members/search', + '/indexes/members/search', { q: text, filter: filters, diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index 0ad497bf..98e96990 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -6,7 +6,6 @@ @if(auth()->id()) - @endif @vite('resources/js/app.js')