Answer the question
In order to leave comments, you need to log in
A simple Nginx Unit configuration for SPA. How to redirect all requests to index.html?
{
"listeners": {
"*:8300": {
"pass": "routes"
}
},
"routes": [
{
"match": { "uri": "/api/" },
"action": { "pass": "applications/api" }
},
{
"match": {"uri": ["*.css", "*.ico", "*.jpg", "*.js", "*.png", "*.html"] },
"action": {"share": "/var/www/site.ru/dist/", "fallback": { "return": 404 }}
},
{
"action": {
/* ???????????????? */
"pass": "/var/www/site.ru/dist/index.html"
}
}
],
"applications": {
"api": {
"type": "php",
"root": "/var/www/site.ru/api/",
"script": "index.php"
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question