LoginSignup
3
3

More than 5 years have passed since last update.

angularjsをhtml5モードで動かす場合のnginxの設定

Last updated at Posted at 2015-07-17

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/

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3