There seems to be a strange problem with my Azure webapp. I can't view MP4 files on my browser at all. After exploring few articles here, I did the following:
I use Github continuous deployment, so I created a new file called "Web.config". The content of it is the following:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
I made sure on the FTP that the file exists in the '/site/wwwroot' directory, and it does. I also made sure the MP4 file exists on the FTP in an accessible location.
The error I get on the website is the following:
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
Can anyone help me debug this problem?
Following our discussion, your web.config is right.
You have to make sure to locate it in the right location to make it works (the virtual application root in your case).
As Azure App Service is using IIS, you can find more details regarding IIS configuration files here: http://www.iis.net/learn/get-started/planning-your-iis-architecture/deep-dive-into-iis-configuration-with-iis-7-and-iis-8
I hope this helps,
Related
A basic question, but I can not find how to do this.
I need to put a .appxbundle file hosted on a Azure WebApplication, but when I try to download, it
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
If, for example, I rename to .appxbundle.zip, then the file downloads normally.
I solved adding the staticContent tag on the Web.config file, under system.webServer, as follows:
<?xml version="1.0"?>
<system.webServer>
<staticContent>
<remove fileExtension=".appinstaller" />
<remove fileExtension=".appxbundle" />
<remove fileExtension=".cer" />
<remove fileExtension=".ps1" />
<remove fileExtension=".psd1" />
<remove fileExtension=".appx" />
<mimeMap fileExtension=".appinstaller" mimeType="application/xml" />
<mimeMap fileExtension=".appxbundle" mimeType="application/xml" />
<mimeMap fileExtension=".cer" mimeType="application/x-x509-ca-cert" />
<mimeMap fileExtension=".ps1" mimeType="text/plain" />
<mimeMap fileExtension=".psd1" mimeType="text/plain" />
<mimeMap fileExtension=".appx" mimeType="application/vns.ms-appx" />
</staticContent>
</system.webServer>
Source: https://blogs.msdn.microsoft.com/africaapps/2013/06/07/how-to-serve-static-json-files-from-a-windows-azure-website/
The custom fonts I am using on my website aren't provided by IIS 8.5.
I have set the MIME-Types as followed:
<remove fileExtension=".ttf" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
.eot works fine (or at least doesn't give me errors in the web debugging windows).
The other formats (woff, woff2, tff) won't work and give me a 404 Not found error.
I think IIS has access to the fonts folder as the eot files work just fine.
Firefox throws this error:
GET
https://prefix.someurl.iis/Resources/Fonts/GlyphaLTStd.woff [HTTP/1.1 404 Not Found 53ms]
Any help appreciated.
Alright, I was able to fix it.
Turns out my lazyness got in the way again (why does this keep happening..?).
Lazy me copied the reference source paths in the font-face declarations so the CSS file didn't get the source-url properly somehow.
Hope this helps other people.
When setting up universal links for iOS apps, Apple states:
Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle.
Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root of your server or in the
.well-known subdirectory.
We have created a file named "apple-app-site-association" without an extension, but if navigate to "http://ourdomain.com/apple-app-site-association" we get a 404 file not found error.
Apple specifies not to add a .json to the filename.
We see another SO overflow answer describing configuration changes to IIS to serve files without extensions. But what is the trick to getting this file to be served properly from GoDaddy's Linux or IIS servers?
I was able to get this to work by adding an .htaccess file at the root level that contains:
<Files "apple-app-site-association">
ForceType application/json
</Files>
Oddly, I could not get this to work if I tried to put the apple-app-site-association and the .htaccess files in the .well_known directory.
With this configuration, the validator here https://branch.io/resources/universal-links/ was all green and the links themselves worked.
This is what worked for us.
We put this text in a file named "web.config" in our main web directory along with the apple-app-site-association file.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".xml"/>
<remove fileExtension=".svg" />
<remove fileExtension=".ttf" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".json" />
<remove fileExtension=".otf" />
<remove fileExtension=".mp4" />
<remove fileExtension=".zip"/>
<remove fileExtension=".eps"/>
<remove fileExtension=".pdf"/>
<mimeMap fileExtension=".pdf" mimeType="application/pdf" />
<mimeMap fileExtension=".zip" mimeType="application/zip"/>
<mimeMap fileExtension=".eps" mimeType="application/octet-stream"/>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".otf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".xml" mimeType="text/xml" />
<mimeMap fileExtension="." mimeType="application/pkcs7-mime"/>
</staticContent>
</system.webServer>
</configuration>
Of note, that properly serves the file without an extension - BUT - as we understand it - Apple still requires two other steps. (1) Your server must get an SSL certificate so it can serve that file by HTTPS (that is a ~$60/year purchase on GoDaddy); (2) Your server must also code-sign the apple-app-site-association file (that is a ~$150/year on GoDaddy for a downloadable certificate which can code sign files.)
I've got a test Wordpress site running in Azure as an Azure Website using the Wordpress install from the Azure gallery.
The site is functional and appears to be working as expected. With one exception. I'm using a custom webfont - http://fortawesome.github.io/Font-Awesome/.
This font has an OTF, SVG, TTF, EOT and WOFF version. From what I understand different devices/browsers use different versions of the file to render to the font.
I'm having a problem serving the .woff version of the file.
I have turning on the logging within the Azure portal and I can see the following error
SECURITY_DENIED_BY_MIMEMAP
FileName
C:\DWASFILES\SITES\WWW-MYWPTESTSITE\VIRTUALDIRECTORY0\SITE\WWWROOT\WP-CONTENT\THEMES\AVADA\AVADA\FONTS\FONTAWESOME-WEBFONT.WOFF
I have confirmed that the .woff file exists on the server by logging into via SFTP and browsing to the folder.
I have seen other posts online about adding this information to the web.config file. Something like:
<?xml version="1.0"?>
<!-- Web.Config Configuration File -->
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
</configuration>
However, I'm not sure how this can, or should, be added to the Azure hosted site.
UPDATE: Save the above code as web.config and upload to the wwwroot folder. Azure will now allow the .woff font to be downloaded when requested.
Save the following as web.config. Upload the web.config file to the wwwroot folder of the site hosted in Azure. The .woff files will now be served.
<?xml version="1.0"?>
<!-- Web.Config Configuration File -->
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
</configuration>
Does anyone know if it is possible to add the SVG mime type to a Windows Azure Website?
I tried with a web.config file but that only broke my website.
Is this a limitation of the current preview or am I missing something?
thanks for your help!
What you can do in Windows Azure Websites (on web.config level) is pretty limited, but you should be allowed to add the mime type under staticContent:
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
</configuration>
Others like me may have reached here having the same problem not resolved because of other related file types, in my case I also needed .eot and .woff mime mappings.
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>