Here's the deal: I installed the simplest nginx configuration for angular practice, and I configured routeProvider to use html5mode. So far, so good! I set the base to '/', my links to / view 1 and / view2 work fine, but only when I click these links on my index page. When I try to access them directly in the browser (or reload the page), nginx returns me 403 forbidden ones. This is a simple configuration, but I cannot find a simple explanation :(
I want everything to be configured in such a way that any route works fine, no need to explicitly set it (one by one) in my nginx site.conf. By the way, the permissions are good!
Here is the actual conf file:
server { listen *:80; server_name rbs.ang; root /_dev/angularjs/app; index index.html; charset UTF-8; location / { expires -1; add_header Pragma "no-cache"; add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; try_files $uri $uri/ index.html; } }
angularjs nginx
Ricardo schalch
source share