I hope you are doing well!
The 405 error is caused merely by a server-side problem. If it displays the 405 Not Allowed error message, you will have several options to solve this problem. You can resolve the error in the following ways,
Enable HTTP methods:
Look upon the settings of the software components that are responsible for responding to HTTP requests. It can be controlled using the AllowMethods directive in the <Location> containers, which is needed to define settings for one or more desired URLs. You will have to implement the following entry:
AllowMethods GET POST OPTIONS
Change up the source code:
=> paste this code:
ProxyPass "/" "http://localhost:9200/"
ProxyPassReverse "/" "http://localhost:9200/"
sudo a2ensite elasticsearch.conf
Please change all indexers as Update by Schedule mode in system-> index management.
Review if you have a named “default” stock source on your admin. Under Stores > Inventory > Sources. If you don’t have this one, let’s create it. If the problem persists, try running the following commands below:
rm -rf generated/*
php bin/magento indexer:reset
php bin/magento indexer:reindex
php bin/magento cache:clean
I hope the above fixes help you resolve the 405 http error.