ファイルがあったらそれを返し、ない場合はindex.htmlを返す。
location / {
try_files $uri /index.html;
}
css, js, imageを一緒に配信している場合でもうまく動くのでこれに落ち着きました。
参考
stack overflow - nginx: send all requests to a single html page
More than 5 years have passed since last update.
ファイルがあったらそれを返し、ない場合は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