使用 .asmx 使用 lighttpd 和 mono fastcgi
我已将 Web 服务部署到运行 lighttpd 和 fastcgi-mono-server2 的 ubuntu 服务器。 .asmx 页面加载正确,但当我测试该方法时,我得到 404。
我的 Web 服务称为 Import.asmx,我的方法称为 download,404 返回说 import.asmx/download 不存在
使用 xsp2 相同的服务工作完美,
我认为这与 lighttpd/fastcgi 如何提供 /download 有关,但不知道如何修复它。
I have deployed a web service to a ubuntu server running lighttpd and fastcgi-mono-server2. The .asmx page loads correctly but when I test the method I get a 404.
My web service is called Import.asmx and my method is called download and the 404 comes back saying import.asmx/download does not exist
Using xsp2 the same service works perfectly
I assume it is something to do with how the /download gets served by lighttpd/fastcgi but cannot work out how to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决了 404 错误...但现在我有 500 错误。
实际上我在每次 MyService.asmx/SomeMethod post 调用时都会收到此错误。解决方案[不是真的]我已经弄清楚了:
我已将其从仅 asmx 更改为 asmx/()*。好的,没有 404,但现在是 500:System.Web.HttpException:访问文件“/Services/MyService.asmx/MyMethod”时不允许使用方法“POST”。
这一发现给了我一些线索,表明 nginx 无法正确处理此类请求。经过谷歌搜索近2个小时后,我发现了 解决方案:
我离它并不远。只需在当前位置规则之前添加此位置规则即可正常工作。
Solved the 404 error... but now I have a 500.
Actually I was getting this error on every MyService.asmx/SomeMethod post calls. The solution [NOT REALLY] I've figured it out:
I've change it from only asmx to asmx/()*. Ok no 404 but now a 500: System.Web.HttpException: Method 'POST' is not allowed when accessing file '/Services/MyService.asmx/MyMethod'.
This findings give me some clues that nginx don't handle properly this kind of requests. After googling for almost 2 hours I've found a solution:
I wasn't to far from it. Just add this location rule before the current you have and works fine.
我有同样的问题。事实证明,这是在未找到资产时提供 404 服务的默认指令。删除了以下行:
并在 /etc/nginx/fastcgi_params 中添加
PATH_INFO
作为 fastcgi 参数:这为我解决了这个问题。希望有帮助。
I had the very same issue. Turned out to be default directive for serving 404 when not finding assets. Removed the following line:
And add
PATH_INFO
as fastcgi param in /etc/nginx/fastcgi_params:That fixed it for me. Hope it helps.