Redirect meilisearch to container
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
philipp lang 2024-01-28 19:14:12 +01:00
parent f5d1313858
commit 631725c0f9
3 changed files with 12 additions and 2 deletions

View File

@ -36,6 +36,17 @@ http {
proxy_read_timeout 60; proxy_read_timeout 60;
proxy_connect_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 / { location / {
try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ /index.php?$query_string;
} }

View File

@ -4,7 +4,7 @@ export default function useSearch() {
const axios = inject('axios'); const axios = inject('axios');
async function search(text, filters = []) { async function search(text, filters = []) {
var response = await axios.post( var response = await axios.post(
document.querySelector('meta[name="meilisearch_baseurl"]').content + '/indexes/members/search', '/indexes/members/search',
{ {
q: text, q: text,
filter: filters, filter: filters,

View File

@ -6,7 +6,6 @@
<meta name="socketport" content="{{env('SOCKET_PORT')}}" /> <meta name="socketport" content="{{env('SOCKET_PORT')}}" />
@if(auth()->id()) @if(auth()->id())
<meta name="meilisearch_key" content="{{config('scout.meilisearch.key')}}" /> <meta name="meilisearch_key" content="{{config('scout.meilisearch.key')}}" />
<meta name="meilisearch_baseurl" content="http://localhost:7700" />
@endif @endif
@vite('resources/js/app.js') @vite('resources/js/app.js')
</head> </head>