This question has reoccurred to me due to Response Compression, Response Caching, and URL Rewriting middlewares hitting the scene.
Some IIS modules can process requests/responses with the reverse-proxy setup and others don't work. For example, IIS Dynamic Compression (DynamicCompressionModule) works, while IIS Static Compression (StaticCompressionModule) doesn't work.
Should we provide a pair of lists in the Publish to IIS doc (or the ANCM Configuration Reference doc) that shows which IIS modules work and which ones don't work?
Reference List: https://www.iis.net/learn/get-started/introduction-to-iis/iis-modules-overview
Sounds like good content to have. I'm not sure the Publish to IIS doc is really the right place though. I definitely wouldn't put it in the ANCM Config Reference. Maybe a separate topic? We really need to rework the TOC for hosting and publishing.
Call it IIS modules that work with ASP.NET Core.
Or maybe "Using IIS Modules with ASP.NET Core"?
Module | Works | ASP.NET Core Option
--- | :---: | ---
Anonymous AuthenticationAnonymousAuthenticationModule | Yes |
Basic AuthenticationBasicAuthenticationModule | Yes |
Client Certification Mapping AuthenticationCertificateMappingAuthenticationModule | ? (1) |
CGICgiModule | No |
Configuration ValidationConfigurationValidationModule | Yes* |
HTTP ErrorsCustomErrorModule | No* | Status Code Pages Middleware
fundamentals/error-handling#configuring-status-code-pages
Custom LoggingCustomLoggingModule | Yes |
Default DocumentDefaultDocumentModule | No* | Default Files Middleware
fundamentals/static-files#serving-a-default-document
Digest AuthenticationDigestAuthenticationModule | Yes |
Directory BrowsingDirectoryListingModule | No* | Directory Browsing Middleware
fundamentals/static-files#enabling-directory-browsing
Dynamic CompressionDynamicCompressionModule | Yes* | Response Compression Middleware
fundamentals/response-compression
TracingFailedRequestsTracingModule | Yes* | ASP.NET Core Logging fundamentals/logging.md#the-eventsource-provider
File CachingFileCacheModule | No | Response Caching Middleware
performance/caching/middleware
HTTP CachingHttpCacheModule | No* | Response Caching Middleware
performance/caching/middleware
HTTP LoggingHttpLoggingModule | Yes* | ASP.NET Core Logging
Implementations: elmah.io, Loggr, NLog, Serilog
fundamentals/logging
HTTP RedirectionHttpRedirectionModule | Yes* | URL Rewriting Middleware
fundamentals/url-rewriting
IIS Client Certificate Mapping AuthenticationIISCertificateMappingAuthenticationModule | Yes* |
IP and Domain RestrictionsIpRestrictionModule | Yes* |
ISAPI FiltersIsapiFilterModule | Yes | Middleware
fundamentals/middleware
ISAPIIsapiModule | Yes | Middleware
fundamentals/middleware
Protocol SupportProtocolSupportModule | Yes* |
Request FilteringRequestFilteringModule | Yes* | URL Rewriting Middleware IRule
fundamentals/url-rewriting#irule-based-rule
Request MonitorRequestMonitorModule | Yes* |
URL RewritingRewriteModule | Yes* (2) | URL Rewriting Middleware
fundamentals/url-rewriting
Server Side IncludesServerSideIncludeModule | No* |
Static CompressionStaticCompressionModule | No* | Response Compression Middleware
fundamentals/response-compression
Static ContentStaticFileModule | No* | Static File Middleware
fundamentals/static-files
Token CachingTokenCacheModule | Yes |
Custom TracingTracingModule | | https://github.com/aspnet/IISIntegration/issues/314
URI CachingUriCacheModule | Yes |
URL AuthorizationUrlAuthorizationModule | Yes* | ASP.NET Core Identity
security/authentication/identity
Windows AuthenticationWindowsAuthenticationModule | Yes |
*Tested by @guardrex
isFile and isDirectory do not work with ASP.NET Core applications due to the difference in directory structure.Module | Works | ASP.NET Core Option
--- | :---: | ---
AnonymousIdentification | No |
DefaultAuthentication | No |
FileAuthorization | No |
FormsAuthentication | No | Cookie Authentication Middleware
security/authentication/cookie
OutputCache | No | Response Caching Middleware
performance/caching/middleware
Profile | No |
RoleManager | No |
ScriptModule-4.0 | No |
Session | No | Session Middleware
fundamentals/app-state#installing-and-configuring-session
UrlAuthorization | No |
UrlMappingsModule | No | URL Rewriting Middleware
fundamentals/url-rewriting
UrlRoutingModule-4.0 | No | ASP.NET Core Identity
security/authentication/identity
WindowsAuthentication | No |
<system.webServer> https://www.iis.net/configreference/system.webserverweb.config. Redeployment of web.config with the app will revert the changes made in IIS Manager.<configuration>
<system.webServer>
<httpRedirect enabled="false" />
</system.webServer>
</configuration>
or modules enabled at the server level can be disabled:
<configuration>
<system.webServer>
<modules>
<remove name="{Module Name}" />
</modules>
</system.webServer>
</configuration>
RewriteModule is listed after the AspNetCoreModule in the ordered modules list, but rewriting an image URL in IIS worked (more info needed).@danroth27 @Rick-Anderson I'll work through collecting data for this. I'll take relevant notes as I go in case there is more to say than "Yes" for any given module.
@Tratcher @pan-wang @shirhatti
I filled in the table with some local testing results (marked *). I could use some feedback to help ...
As it stands, my crude outline is ...
I also have an interest in whatever the minimal module/handler config is for IIS/ANCM and (crudely) determining the perf boost associated with the minimal module/handler config. However, I doubt you will want that in this doc. http://madskristensen.net/post/remove-default-http-modules-in-aspnet
FormsAuthentication is replaced by the CookieAuthentication middleware
/cc @jhkimnew
Some pieces of RewriteModule do not work with Core, (e.g. IsFile or IsDirectory), due to changes in the file structure layout.
Hi!
I try to use IISClientCertificateMappingAuthentication without any success.
The IIS identifies my client certificate, but I'm not able to obtain the User object from my AspNetCore Web API application.
Can you provide me some example how to use that module? Or I'm only able to get the client certificate?
I'm trying to use it in AspNetCore Web API 2.1
Thanks!
Hello @carathorys ... This issue is closed. Could you open a new issue for that on this repo? Use the Content Feedback button at the bottom of the live topic: https://docs.microsoft.com/aspnet/core/host-and-deploy/iis/modules