Created
July 29, 2018 20:49
-
-
Save shahiddev/158940630d641e019c13e418c94ee94c to your computer and use it in GitHub Desktop.
Using Function proxies to proxy to azure storage static pages and add security heads to response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json.schemastore.org/proxies", | |
"proxies": { | |
"index": { | |
"matchCondition": { | |
"route": "/", | |
"methods": [ | |
"GET", | |
"HEAD" | |
] | |
}, | |
"backendUri": "https://%STORAGEACCOUNTADDRESS%/Index.html?%STORAGEACCOUNTSAS%", | |
"responseOverrides": { | |
"response.headers.strict-transport-security": "max-age=31536000; includeSubDomains", | |
"response.headers.X-Powered-By": "redacted", | |
"response.headers.X-Content-Type-Options": "nosniff", | |
"response.headers.X-XSS-Protection": "1; mode=block", | |
"response.headers.x-ms-blob-type": "redacted", | |
"response.headers.x-ms-lease-state": "redacted", | |
"response.headers.x-ms-lease-status": "redacted", | |
"response.headers.Server": "redacted", | |
"response.headers.x-frame-options": "SAMEORIGIN", | |
"response.headers.Content-Security-Policy": "script-src 'self'", | |
"response.headers.Upgrade-Insecure-Requests": "1", | |
"response.headers.Referrer-Policy": "same-origin", | |
"response.headers.Feature-Policy": "payment 'self'; geolocation 'self'" | |
} | |
}, | |
"otherpages": { | |
"matchCondition": { | |
"route": "/{page}", | |
"methods": [ | |
"GET", | |
"HEAD" | |
] | |
}, | |
"backendUri": "https://%STORAGEACCOUNTADDRESS%/{page}.html?%STORAGEACCOUNTSAS%", | |
"responseOverrides": { | |
"response.headers.strict-transport-security": "max-age=31536000; includeSubDomains", | |
"response.headers.X-Powered-By": "redacted", | |
"response.headers.X-Content-Type-Options": "nosniff", | |
"response.headers.X-XSS-Protection": "1; mode=block", | |
"response.headers.x-ms-blob-type": "redacted", | |
"response.headers.x-ms-lease-state": "redacted", | |
"response.headers.x-ms-lease-status": "redacted", | |
"response.headers.Server": "redacted", | |
"response.headers.x-frame-options": "SAMEORIGIN", | |
"response.headers.Content-Security-Policy": "script-src 'self'", | |
"response.headers.Upgrade-Insecure-Requests": "1", | |
"response.headers.Referrer-Policy": "same-origin", | |
"response.headers.Feature-Policy": "payment 'self'; geolocation 'self'" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment