Why am I getting a 403 forbidden error only on put request API from CentOS 7 vps server (while get/post are working well)?
The same piece works fine on a shared hosting server and from localhost.
I am using “Nginx + Varnish + Apache”
Whenever I try to execute any PUT request, this is the response:
Forbidden
You don’t have permission to access /api/path/to/my/api on this server.
3
Answers
You will have to use POST method along with
_method
=PUT
as a form data:You have to explicitly permit PUT requests to your endpoint unlike GET and POST. You should look into your .htaccess settings.
This question addresses the same concern and this also.
Config your apache virtual host by these conditions:
Maybe your problem solved.