[wp-trac] [WordPress Trac] #40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't enabled
WordPress Trac
noreply at wordpress.org
Tue May 30 12:00:09 UTC 2017
#40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't
enabled
--------------------------+-----------------------------
Reporter: Joen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7
Severity: normal | Keywords:
Focuses: rest-api |
--------------------------+-----------------------------
Steps to reproduce:
1. have a web server running nginx, or use wp docker or vvv fresh installs
2. have fancy permalinks disabled, use the stock `?p=123` ones
3. install the Gutenberg editor from
https://github.com/WordPress/gutenberg as an activated plugin. Be sure to
`npm install`, `npm run build` etc.
4. load the Gutenberg menu item in the sidebar
5. Press Save draft button, then press Update, and you'll see an error
message in the console: `PUT http://localhost/?rest_route=/wp/v2/posts/6
405 (Not Allowed)`
If you go to Settings > Permalinks, and choosing any fancy permalink
option, saving works fine.
From @pento:
> So, it seems that `ngx_http_index_module`, the nginx module that
redirects `/` to `/index.php` ignores all methods except `GET`, `HEAD`,
and `POST`.
> Editing the post sends a `PUT`, which is rejected.
See also, trac discussion starting here:
https://wordpress.slack.com/archives/C02RQC26G/p1496136902282711
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40886>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list