Lighttpd configuration and vue router history


Problem 😱

Expected behaviour:

file_path = request.path

if file_path.is_present_on_disk():
  return open(file_path)

return open(index.html)

nginx

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

But how to do it in Lighttpd?


Solution 🤓

🎉 🎉 🎉 use url.rewrite-if-not-file 🎉 🎉 🎉

url.rewrite-if-not-file = (
     "/.*" => "/index.html"
)

Imgur