Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问HTTP OPTIONS 返回 405 Not Allowed是怎么回事? #27

Open
ghost opened this issue May 7, 2018 · 0 comments
Open

请问HTTP OPTIONS 返回 405 Not Allowed是怎么回事? #27

ghost opened this issue May 7, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented May 7, 2018

当我进行跨域请求时(OPTIONS方法),就会提示我 405 Not Allowed,感觉在PHP中设置的header并没有起作用。我想肯定时nginx拦截了请求。但是假如我自己修改nginx配置的话,那肯定没有PHP header函数方便。我想问下,咱们的demo网站是如何处理这个问题的?因为我看到咱们也是用的Ngxin。希望得到回答,谢谢~

下面是我在本地使用telnet模拟发送http options 请求得到的结果:

OPTIONS / HTTP/1.1
Host: www.test.com

HTTP/1.1 405 Not Allowed
Server: nginx
Date: Mon, 07 May 2018 09:11:50 GMT
Content-Type: text/html
Content-Length: 166
Connection: keep-alive

<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants