Azure网站.众所周知的路由变得不可访问 [英] Azure websites .well-known route becomes inaccessible

查看:78
本文介绍了Azure网站.众所周知的路由变得不可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作文件:

.well-known/apple-developer-merchantid-domain-association

可通过我的Azure网站访问.我已将此添加到路由配置中:

accessible via my Azure website. I have added this to the route config:

routes.MapRoute(
    name: "ApplePay-MacOS",
    url: ".well-known/apple-developer-merchantid-domain-association",
    defaults: new { controller = "Home", action = "WellKnownApplePay" });

这指向发出文件的控制器操作.

Which points to a controller action that gives the file out.

现在,当我在本地IIS和IIS Express上对其进行测试时,一切都可以正常工作,但是当我将其上传到天蓝色时,它只是不接受点".URL中的字符.如果我将其删除,则可以正常工作,并且文件在发布为天蓝色后也将下载.我需要它与圆点配合使用,因为这是我的网站对Apple Pay的要求.

Now everything works when I test it on my local IIS and IIS Express but when I upload it to azure it just isn't accepting the dot "." character in the URL. If I remove it then it works and the file downloads after it has been published to azure. I need it to work with the dot as that is what apple pay requires of my site.

推荐答案

我能够使用其他方法解决此问题.我停止尝试为证书编写路由,并根据Peter Hahndorf在这里的答案将web.config添加到目录中:

I was able to solve this using a different approach. I stopped trying to write routing for the certificate and added a web.config into the directory per Peter Hahndorf's answer here: IIS: How to serve a file without extension?

<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <system.webServer>
         <staticContent>
             <mimeMap fileExtension="." mimeType="text/xml" />
         </staticContent>
     </system.webServer>
 </configuration>

这篇关于Azure网站.众所周知的路由变得不可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆