Azure网站.众所周知的路由变得不可访问

编程入门 行业动态 更新时间:2024-10-26 01:20:47
本文介绍了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添加到目录中: IIS:如何在没有扩展名的情况下提供文件?

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网站.众所周知的路由变得不可访问

本文发布于:2023-11-08 06:52:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568645.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   众所周知   网站   Azure

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!