etr*_*rey 2 nginx json-api wordpress-json-api
出于某种原因"开箱即用",Wordpress JSON API无法在Nginx上运行.我在nginx conf中尝试了几种重定向方案.我唯一能做的就是?json.但是,这不适用于身份验证和注册.
作为一个FYI,我正在开发一个cordova应用程序并尝试使用WP JSON API进行WP后端.
nor*_*ree 14
我的Nginx conf for wp-json API。
location / {
# http://v2.wp-api.org/guide/problems/#query-parameters-are-ignored
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ ^/wp-json/ {
# if permalinks not enabled
rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4256 次 |
| 最近记录: |