【发布时间】:2026-02-09 23:30:01
【问题描述】:
我在私人服务器上托管 web 服务。然后我在公共服务器(互联网服务器)中的 IIS 中创建了 URL 重写规则。
每次我访问 URL 时,它都会在浏览器的 URL 中明确显示私有服务器的 ip/计算机名称,而不是公共 url/IP。当我点击查看脚本的 URL 时,它显示“Example.svc 不存在”错误。
当我尝试通过在其中传递 URL 将其添加为 Visual Studio 中的服务引用时,它也不起作用。它会引发以下错误。
The request failed with HTTP status 400: Bad request
Metadata contains a reference that cannot be resolved: <SERVER URL>
The remote server turned an unexpected response: (405) Method not allowed.
我应该怎么做才能公开访问该 URL 并能够将其添加为 Visual Studio 中的参考?
【问题讨论】:
-
这只是表明你应该设置一个反向代理,docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/…
标签: web-services http url-rewriting iis-8