apache 可以配置为忽略 OPTIONS 请求吗?
我为工作中的几个部门运行一个小型网络应用程序,该应用程序的流量非常低,并且没有那么多用户。它构建在 Django 之上,并使用 apache 作为 Web 服务器。 我配置了一些东西,可以在发生任何错误时向我发送电子邮件,直到昨天这还是一件很棒的事情 - 错误不多,但有时用户在遇到问题时不会说出来,因此它使我能够掌握最新情况。
昨天我们有了一个新用户,我开始收到大量错误电子邮件。他不知道出了什么问题,所以我认为这是幕后的事情。当我查看日志时,它们是使用“Microsoft 数据访问 Internet 发布提供商协议”和“Microsoft Office 协议发现”的 HTTP OPTIONS 请求。在那之前我从未听说过这个,但它似乎是某种 MS Web 文件夹/webDAV 的东西。
一个选择是弄清楚他如何关闭它并告诉他停止这样做,但我宁愿在这里砍掉头并做一些类似让 apache 不将这些请求传递给 Django 的事情有没有一种方法可以这可以处理吗?
I run a small webapp for a couple of departments at work, which is very low traffic and doesn't have that many users. It's built on top of Django and uses apache as the web server.
I have things configured to email me when any errors occur which until yesterday was a great thing - there aren't many errors, but sometimes the users don't speak up when they encounter problems, so it allows me to stay on top of things.
Yesterday we had a new user, and I started getting tons of error emails. He had no idea that anything was wrong, so I figured it was something behind the scenes. When I looked at the logs, they are HTTP OPTIONS requests which are using the "Microsoft Data Access Internet Publishing Provider Protocol" and "Microsoft Office Protocol Discovery". I'd never heard of this until that point, but it appears to be some sort of MS web folders/webDAV thing.
One option is to figure out how he can turn that off and tell him to stop doing that, but I'd rather just cut the head off here and do something like have apache just not pass on those requests to Django Is there a way that this can be handled?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
重写选项很好,“Apache Way”可能更像是:
或者......
The rewrite option is good, the 'Apache Way' is probably more like:
or...
我找到了一个由不同框架使用的解决方案并移植到 Django。我将其放置在生成带有 .XLS 或 .DOC 文件链接的 HTML 的任何视图的顶部:
不过,我更喜欢 Apache 解决方案...假设它不会在 Windows 方面造成问题。
I found a solution used by a different framework and ported to Django. I place this at the top of any view that generate HTML with links to .XLS or .DOC files:
I like Apache solution better though... assuming it doesn't cause problems on the Windows side of things.
怎么样:(
启用mod_rewrite。)
How about:
(With mod_rewrite enabled.)