angularjsをhtml5モードで動かす場合のnginxのconf設定
xxx.conf
location / {
try_files $uri$args $uri$args/ /index.html;
}
ただしこの場合、angularjs側でbase設定する必要があるらしい。
雑感
urlをrewriteして#を入れるとか思考錯誤した結果、rewriteする必要すらなかったとか。。
参考サイト
http://andredublin.github.io/blog/2014/08/18/nginx-and-angularjs-url-routing/
https://docs.angularjs.org/guide/$location
http://hail2u.net/blog/webdesign/terror-of-hashbangs.html
http://taka-yag.hatenablog.com/entry/2013/12/28/041727
https://siguniang.wordpress.com/2014/02/16/nginx-url-rewriting-difference-between-break-and-last/