How to disable BrotliCompressionModule on particular application

1

By default, IIS installed the gzip compression HTTP module. Later, I had installed Brotli Compression HTTP Module for IIS to improve the compression ratio for browsing content. In the ApplicationHost.config, brotli has been added in the three places as the below.

  1. globalModules
  2. httpCompression
  3. modules

    <system.webServer>
    <globalModules>
       <add name="BrotliCompressionModule" image="%Windir%\system32\inetsrv\IisBrotli.dll" preCondition="bitness64" />
    </globalModules>
    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
        <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
        <scheme name="br" dll="%Windir%\system32\inetsrv\IisBrotli.dll" staticCompressionLevel="5" dynamicCompressionLevel="5" />
    </httpCompression>
    <location path="" overrideMode="Allow">
        <system.webServer>
        <modules>
                <add name="BrotliCompressionModule" preCondition="managedHandler,runtimeVersionv4.0" />
        </modules>
        </system.webServer>
    </location>
    

I have dashboard application, which is 32bit application and compatible to run on IIS, Application was working fine before installing Brotli Compression HTTP Module in IIS.

After installing the brotli compression, Application has not working due to brotli stopped the DashboardApplication pool. Then I have found the following root cause for this issue.

Brotli is 64bit application which doesn't allow the my 32bit application on IIS. Based on the forum solutions, I have added preConditon="bitness64", which helps to run the globalModules for 64bit application alone.

Above solution helped to avoid stopping application pool. Then new issue raised as Couldn't found the BrotliCompressionModule file. We have found solution to remove brotli module from web.config of my application as below. It helped to resolved the file not found issue.

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
    <remove name="BrotliCompressionModule" />
</modules>
</system.webServer>

Then, another issue -HTTP Error 500.19 - Internal Server Error with Error Code 0x800700c1 raised.

Already, we had avoided brotli compression on and local section, but not in section.

If i removed the Brotli from httpCompression section, my 32bit dashboard application works well. but it would not compress other application in brotli module.

I suspect that we need to avoid brotli in httpCompression section too, but I coudn't found the solution.

Note: I need both gzip and br(Brotli) compressions. Since Brotli to be used for my other 64bit applications.

Is this possible to disable brotli compression for particular 32bit application on IIS? At the same time Brotli needs to be worked for other appliction sites.

Thanks in Advance.

.net
iis
brotli
asked on Stack Overflow Feb 11, 2020 by vinothtechie • edited Feb 11, 2020 by vinothtechie

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0