gebeer Posted December 4, 2022 Share Posted December 4, 2022 Hello all, there are some older posts about nginx configuration for PW like @LostKobrakai created a gist. We have some sites in production on apache with nginx reverse proxy. One of those is receiving webhooks from snipcart. And in some situations the POST requests from snipcart are redirected through nginx and the POST request body data gets lost in this process. We are receiving those requests in apache with headers like where "HTTP_X_HTTP_METHOD_OVERRIDE": "POST" is sent like this by snipcart ... "REQUEST_METHOD": "GET", "HTTP_X_HTTP_METHOD_OVERRIDE": "POST", "QUERY_STRING": "it=/webhooks/snipcart/&", ... file_get_contents('php://input'); is null in those cases. After doing some research I found it could be related to the location / { try_files $uri $uri/ /index.php?it=$uri&$args; } directive in the nginx vhost.conf. I couldn't find the reason for the nginx redirect since the POST request is going to an existing endpoint /webhooks/snipcart/ (with trailing slash) and making test requests with POSTMAN didn't result in redirects. Has anyone else experienced this behaviour and knows a solution? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now