Comments (7)
I have adopted @firstred’s answer for nginx:
location /search {
rewrite /search/(.*) /$1 break;
proxy_pass http://127.0.0.1:7700;
}
location / {
if ($http_referer ~* ^.*/search/.*$ ) {
proxy_pass http://127.0.0.1:7700;
}
}
from mini-dashboard.
Not sure yet what the nginx equivalent is, but I managed to solve the problem with Caddy by matching the Referer
header.
If the request's Referer
header contains /search/
, it will strip /search
from the path and effectively serve css js etc. from root.
route {
##### Ensure trailing slash
redir /search /search/
##### Serve Meilisearch from a subfolder, by matching the path
@meilisearch path /search/*
##### Serve assets from the subfolder, by matching the HTTP Referer header
@meilisearch_assets header Referer */search/*
handle @meilisearch {
uri strip_prefix /search
header X-Forwarded-Proto {scheme}
header X-Forwarded-Host {host}
reverse_proxy meilisearch:7700
}
handle @meilisearch_assets {
uri strip_prefix /search
header X-Forwarded-Proto {scheme}
header X-Forwarded-Host {host}
reverse_proxy meilisearch:7700
}
}
from mini-dashboard.
I'm not sure this is something we want as a curl on /search
I think would return the HTML page. Though I'm sure there is a solution I don't have the required knowledge to play with path and redirections.
from mini-dashboard.
Great! @urbantrout thanks a lot for sharing the nginx version!
from mini-dashboard.
Related meilisearch/product#295
from mini-dashboard.
Do we have any news on this? It looks like a bug fix more than a new feature to me.
The problem with changing to href is that now the mini dashboard is accessible on every sub-route on not only the root of the meilisearch instance.
@bidoubiwa This is the most direct solution but do we have another one at hand?
from mini-dashboard.
Thanks a lot for your answers and suggestions 🙏
I'll now close this issue as this can be fixed with the nginx configuration.
Have a nice day ☀️
from mini-dashboard.
Related Issues (20)
- Sorting and filtering in Search preview HOT 3
- Storybook crashes on launch
- deleteAllIndexes should also be added in test-api-key-required.cy file HOT 4
- Feature request: tasks inspector HOT 3
- Values of `_geo` fields should be displayed as JSON in the dashboard HOT 5
- Replace Slack with Discord
- Update the static directory config in Storybook
- Value as a key breaks Web UI HOT 5
- Console error when you open the mini-dashboard HOT 1
- Console log errors when the dashboard shows documents
- Console errors when using meilisearch with laravel sail HOT 9
- Replace Slack by Discord HOT 2
- Meilisearch Cloud - Document "Show More" button hides all attributes. HOT 7
- Display a warning/message if the api_key url parameter is found HOT 8
- Display a banner mentioning the cloud product HOT 2
- Dark Theme HOT 4
- Add a `noindex` metatag HOT 3
- new dropdown for rendering large list does not properly render the indexes HOT 1
- Cloud promotion banner shows when you are on the cloud product HOT 2
- Browse UI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mini-dashboard.