To exclude the web.config from deployment, you'll need to stop it being put in the package in the first place. The web.config is an essential part of an IIS web application, so our default tools include it. You'll have to use RgPublish.exe with a .nuspec file
if you want to customize the contents of the package.
However, you shouldn't need to exclude the web.config file at all. It's better not to rely on the existing contents of the application directory when doing a deployment. If you need the web.config to be different on the target server than it is in the source code, the best way to achieve that is using variable substitutions and/or config transformations