aumanjoa
aumanjoa

Reputation: 955

azure app-service returning ERR_CONTENT_DECODING_FAILED

I have deployed my node application to azure but getting on all sides this error message: ERR_CONTENT_DECODING_FAILED

I have already tried several things like putting this into my web.config

<urlCompression doStaticCompression="true" doDynamicCompression="true" />
    <httpCompression>
      <dynamicTypes>
        <clear />
        <add enabled="true" mimeType="text/*"/>
        <add enabled="true" mimeType="message/*"/>
        <add enabled="true" mimeType="application/x-javascript"/>
        <add enabled="true" mimeType="application/javascript"/>
        <add enabled="true" mimeType="application/json"/>
        <add enabled="false" mimeType="*/*"/>
        <add enabled="true" mimeType="application/atom+xml"/>
        <add enabled="true" mimeType="application/atom+xml;charset=utf-8"/>
      </dynamicTypes>
      <staticTypes>
        <clear />
        <add enabled="true" mimeType="text/*"/>
        <add enabled="true" mimeType="message/*"/>
        <add enabled="true" mimeType="application/javascript"/>
        <add enabled="true" mimeType="application/atom+xml"/>
        <add enabled="true" mimeType="application/xaml+xml"/>
        <add enabled="true" mimeType="application/json"/>
        <add enabled="false" mimeType="*/*"/>
      </staticTypes>
    </httpCompression>

But nothing works. Can someone help?

The website I deploy is this one: https://github.com/aumanjoa/chronas-community

Upvotes: 1

Views: 1209

Answers (1)

Aaron Chen
Aaron Chen

Reputation: 9950

I took your website and deployed to Azure App Service. After setting the CLOUDINARY_URL value in App settings and connection string of mongo, I got the error as below.

enter image description here

Here is my web.config for reference.

<?xml version="1.0" encoding="utf-8"?>

<configuration>
     <system.webServer>
          <!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
          <webSocket enabled="false" />
          <handlers>
               <!-- Indicates that the app.js file is a node.js site to be handled by the iisnode module -->
               <add name="iisnode" path="keystone.js" verb="*" modules="iisnode"/>
          </handlers>
          <rewrite>
               <rules>
                    <!-- Do not interfere with requests for node-inspector debugging -->
                    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">                    
                        <match url="^keystone.js\/debug[\/]?" />
                    </rule>

                    <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
                    <rule name="StaticContent">
                         <action type="Rewrite" url="public{REQUEST_URI}"/>
                    </rule>

                    <!-- All other URLs are mapped to the node.js site entry point -->
                    <rule name="DynamicContent">
                         <conditions>
                              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
                         </conditions>
                         <action type="Rewrite" url="keystone.js"/>
                    </rule>
               </rules>
          </rewrite>

          <security>
               <requestFiltering>
                    <hiddenSegments>
                         <remove segment="bin"/>
                    </hiddenSegments>
               </requestFiltering>
          </security>

          <httpErrors existingResponse="PassThrough" />

          <iisnode watchedFiles="web.config;*.js" debuggingEnabled="false" />
     </system.webServer>
</configuration>

Obviously, the error differs from yours. So, you may confirm whether your application runs fine locally before you deploy it to Azure. Also, note that gzip compression is enabled by default without any operation. You can check out Azure Web App Not Using GZip Compression and gzip compression in Windows Azure Websites for details.

Upvotes: 1

Related Questions