WDlinux官方论坛's Archiver

nsioo 发表于 2017-8-30 22:40

delete put请求方式报405 Not Allowed、

在网站中使用RESTful方式请求时、POST和get正常;delete、put这类方式就会 405 Not Allowed、
已经从nginx1.8.1升级至1.10.3、排除跨域问题、求解决思路

[attach]7921[/attach][attach]7922[/attach]


centos7
wdcp3.2
单nginx

nsioo 发表于 2017-8-31 08:53

[i=s] 本帖最后由 nsioo 于 2017-8-31 08:56 编辑 [/i]

已解决、问题得靠思路灵感、整半天把nginx源码看了下才意识到可能是请求链接被当成静态文件了;
链接是类似 http://www.***.com/product/template/1 这样形式的伪静态、所以修改了nginx的配置文件中location / 的写法;[code]        location / {
                try_files $uri $uri/ /index.php?$query_string;
        }[/code]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.