vendredi 23 octobre 2015

nginx showing blank page for invalid url

I have an emberjs app and using nginx to serve it. I want to redirect to index page if the file not found. I tried using the following configuration but its showing blank page instead of index page.

server
{
  listen 80 ;
  server_name x.x.x.x
              xyz.example.com;

  root /home/ubuntu/website/dist/;
  index index.html index.htm;
  error_page 404 /home/ubuntu/website/dist/;
  location / {
    try_files $uri $uri.html $uri/ /fallback/index.html;
  }

location /fallback {
    root /home/ubuntu/website/dist;
}
}




Aucun commentaire:

Enregistrer un commentaire