After installation of recent updates for SharePoint 2013 users may receive an HTTP 500 error with the following additional details:
“Cannot read configuration file because it exceeds the maximum file size”
IIS has a default limit of 250 KB for web.config files. SharePoint web.config files are quite large even if no customizations are installed. Additional custom components installed on the SharePoint servers can further increase the web.config files. Some SharePoint security fixes also add additional entries to web.config to ensure that built-in functionality is not affected by restrictions implemented in the security fixes. All this together can in some cases increase the web.config files beyond the 250 KB limit.
To prevent or resolve this issue the following entry should be added or updated in the registry:
(make a backup of the registry before proceeding)
Under the following key
add or update the following DWORD entry: MaxWebConfigFileSizeInKB
Ensure that this entry gets the value of 900 (dec) or 384 (hex)
See here for more details:
Newer SharePoint Versions
Newer SharePoint versions (2016, 2019, Subscription Edition) are not affected by this as they as they update this registry key value during the SharePoint installation.