LoginSignup
38
21

More than 5 years have passed since last update.

SPAを配信するときのnginx設定

Last updated at Posted at 2016-07-28

ファイルがあったらそれを返し、ない場合はindex.htmlを返す。

location / {
    try_files $uri /index.html;
}

css, js, imageを一緒に配信している場合でもうまく動くのでこれに落ち着きました。

参考

stack overflow - nginx: send all requests to a single html page

38
21
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
38
21