Hi all, I need help in using typesense in self-hos...
# community-help
s
Hi all, I need help in using typesense in self-hosted environment. I have typesense and nginx both at same node in production using Ubuntu 22.04. Typesense Reverse proxy is working fine. But if use direct conenction without Laravel Scout, I get typesense, SearchRequestAdaptor, and TypesenInstantSearchAdaptor error. All are giving POST not allowed error. This is happening when i use instantsearch.js UI and use direct connection. with Laravel Scout there is no issue. aalambana.com/business/business-listing is having issue. but https://aalambana.com/classified using Laravel Scout has no issue. I am using below code to connect directly without laravel Scout. In my typesense.ini file i have CORS enabled and for domains https://aalambana.com,https://www.aalambana.com,
Copy code
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
        server: {
            apiKey: "{{ env('TYPESENSE_API_KEY') }}", // Be sure to use an API key that only allows searches, in production
            nodes: [
                {
                    host: '<http://aalambana.com|aalambana.com>',
                    port: '443',
                    protocol: 'https',
                },
            ],
            cacheSearchResultsForSeconds: 2 * 60,
        },
        // The following parameters are directly passed to Typesense's search API endpoint.
        //  So you can pass any parameters supported by the search endpoint below.
        //  queryBy is required.
        //  filterBy is managed and overridden by InstantSearch.js. To set it, you want to use one of the filter widgets like refinementList or use the `configure` widget.
        additionalSearchParameters: {
            query_by: 'name,category.level0,category.level1',
            sort_by: 'is_featured:desc,_text_match:desc,updated_at:desc',
        },
    });