You’re correct, the web.config
file is typically used in Windows environments, specifically with IIS servers.
Since your app is running in a Docker container on a Linux App Service, Nginx is used instead of IIS.
Here are a couple options to add security headers on a Linux App Service:
- Modify your application code to add the headers directly. For example in Node.js:
const helmet = require('helmet')
app.use(helmet())
- Add your App Service as the origin backend pool in Front Door
- Under "Rules Engine", create a new rule to modify response headers
- Add your security headers like Strict-Transport-Security, X-XSS-Protection, X-Frame-Options, etc
This will apply the headers to all responses coming from your App Service through Front Door.