Search code examples
reactjsreact-routeropenwrtuhttpd

uhttpd rewrite all routes to /


I am trying to set up a react app using react router behind a uhttpd server on an embedded device. Unfortunately I do not know how to forward all subroutes (eg. /foo/bar) back to /

In nginx this is possible using the try_files statement. Is there something similar using uhttpd?


Solution

  • Hi I resolved this issue.
    uhttpd have a option "error_page".
    So we must set that option if we decide to use react.

    e.g.

    config uhttpd 'main'
        list listen_http '0.0.0.0:80'
        list listen_http '[::]:80'
        option home '/www'
        option error_page '/index.html'