Why does SlickStack block PUT and DELETE requests in Nginx
- This topic is empty.
March 2025 promo! Join our Discord free of charge.
This has come up a few times so I thought we should have a forum thread for better SEO visibility… if you are using WordPress and Nginx and wondering why certain requests are result in 405 errors such as PUT, DELETE, PATCH etc…
https://github.com/littlebizzy/slickstack/issues/116
It’s because these are disallowed by default in modern servers for the most part, even if you’re not using SlickStack with Nginx.
The immediate reaction from some “full stack” devs might be omg, WordPress is so annoying, or SlickStack is not working properly!
This isn’t the case… it’s usually that they are using unsafe/old-fashioned requests in their WordPress plugin or whatever application having problems….
The truth is WordPress is pretty awesome here, because using the REST API you can send nearly anything using safer POST requests:
https://gridpane.com/kb/making-nginx-accept-put-delete-and-patch-verbs/
And then using query strings, you can generate pseudo-requests to accomplish things that are not typically included in POST requests, but can be with WordPress.
Example:
POST /wp-json/wp/v2/posts/42?_method=DELETE
If you review that article from GridPane they also provide a free “hack” you can add to your Nginx using a small .conf
file to redirect non-POST requests as needed.
But for SlickStack we don’t plan on adding this by default because it’s really just patching poorly coded plugins, etc.
The better solution is to fix the code in question to leverage the REST API better.
More reading on this
And then using query strings, you can generate pseudo-requests to accomplish things that are not typically included in POST requests, but can be with WordPress.
Any properly coded WordPress plugin should be doing this via REST API.
If your plugin is not doing this, hacking your Nginx to accept non-POST requests is just decreasing security and avoiding a long-term solution.
Hey guys, I understand the consequences but for a short time I need to enable PUT request, is there a way to achieve this with SS?
I am referring this guide: https://gridpane.com/kb/making-nginx-accept-put-delete-and-patch-verbs/
But upon the SS monthly update PUT functionality will cease. please suggest how to keep edits even after the monthly updates.
Thanks.
please suggest how to keep edits even after the monthly updates
do you know which SlickStack cron job is overwriting your changes?
Unfortunately. No.
afaik there is no cron job in SlickStack that overwrites Nginx config changes, unless you run ss install
or ss install nginx config
However the SS_LOCKDOWN="true"
in your ss-config should also help avoid that. It’s still being worked on, with community feedback, but when true
it will prevent certain things from being overwritten. It’s not fully supported yet, still being developed.
Friends, the time has come for us to ask for your financial support. After 5+ years of (growing) expenses, and taking time away from consulting and services, we must start generating donations in order to continue this level of rapid project development. Please consider donating, so that we can keep SlickStack free and open source. Thank you! 🙏 😍
We champion core values like free speech, transparency, and portability, and welcome anyone else who does too.
Here is a non-exhaustive list of plugins, themes, and other services that we recommend checking out.
Every stack script and server deployment platform is a bit different, so check to see how SlickStack compares.
Subscribe to our free newsletter to receive occassional updates, we respect your privacy and do not sell your information.
Here’s some of the incredible performance features you can expect after launching your SlickStack cloud VPS.
If you are wondering what specific problems SlickStack can help solve, browse some of the solutions below.
In lieu of donations, please show your support by mentioning SlickStack on your blog or write a review. Thank you!