Skip to content

Instantly share code, notes, and snippets.

@shahiddev
Created July 29, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shahiddev/158940630d641e019c13e418c94ee94c to your computer and use it in GitHub Desktop.
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
{
"$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