From bb6e9d398dc54bb06feedd6069d78a1dbb18ed8a Mon Sep 17 00:00:00 2001 From: Matthias Langhard Date: Tue, 28 Jun 2016 13:45:23 +0200 Subject: [PATCH] Forwards requests to index.html after no file or folder was found Useful for SPA's like AngularJS where the SPA's router takes care of the routing. --- conf/nginx.conf.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/nginx.conf.erb b/conf/nginx.conf.erb index 82e8b4d..3c19791 100644 --- a/conf/nginx.conf.erb +++ b/conf/nginx.conf.erb @@ -19,5 +19,9 @@ http { root /app/www; <% end %> index index.html; + + location / { + try_files $uri $uri/ /index.html; + } } }