-
Notifications
You must be signed in to change notification settings - Fork 6
Nginx OPTIONS 请求 405 错误 #126
Copy link
Copy link
Closed
Labels
Back-endWhere data really come and goWhere data really come and goServerThe invisible heroThe invisible hero
Description
问题描述
业务部署到 CentOS 服务器上之后,没有做全面的测试。最近查看 Nginx 日志,发现其中一项业务的某个 API 一直报 405 错误,上网搜索了一下,需要配置 Nginx 来解决这个问题。
解决流程
- 关键词:
nginx options 405 - 解决方案:Handling OPTIONS request in nginx
关键代码:
location / {
if ($request_method = OPTIONS ) {
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Back-endWhere data really come and goWhere data really come and goServerThe invisible heroThe invisible hero