21
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

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

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

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

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

参考

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

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
21
Help us understand the problem. What are the problem?