Created
February 26, 2022 01:14
-
-
Save ozkary/49723810f1c03d2889b6029d9d50f24d to your computer and use it in GitHub Desktop.
Static Web Apps configuration to handle HTTP 404 errors with a fallback policy
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
{ | |
"routes": [ | |
{ | |
"route": "/", | |
"allowedRoles": ["anonymous"] | |
}, | |
{ | |
"route": "/about", | |
"allowedRoles": ["anonymous"] | |
}, | |
{ | |
"route": "/contact-us", | |
"allowedRoles": ["anonymous"] | |
} | |
], | |
"navigationFallback": { | |
"rewrite": "index.html", | |
"exclude": ["/images/*.{png,jpg,gif}", "/css/*"] | |
}, | |
"responseOverrides": { | |
"400": { | |
"rewrite": "/" | |
}, | |
"401": { | |
"redirect": "/login", | |
"statusCode": 302 | |
}, | |
"403": { | |
"rewrite": "/" | |
}, | |
"404": { | |
"rewrite": "/index.html" | |
} | |
}, | |
"globalHeaders": { | |
"Content-Type": "charset=UTF-8", | |
"content-security-policy": "default-src https: 'self'; object-src 'none'; frame-src 'self'; img-src 'self'", | |
"Access-Control-Allow-Origin": "identity.azurestaticapps.net, *.azurestaticapps.net, *.google-analytics.com, *.visualstudio.com", | |
"X-Frame-Options": "SAMEORIGIN", | |
"Strict-Transport-Security": "max-age=63072000; includeSubDomains; preload", | |
"X-Content-Type-Options": "nosniff", | |
"x-xss-protection": "1; mode=block", | |
"referrer-policy": "same-origin" | |
}, | |
"mimeTypes": { | |
".html": "text/html", | |
"custom": "text/html", | |
".json": "text/json", | |
".css": "text/css", | |
".js": "text/javascript" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment