gravitl / netmaker-ui

Other
66 stars 30 forks source link

[0.17.1] Hosted via Caddy, page refresh gives 404 if it's not the home page #291

Open skygunner opened 1 year ago

skygunner commented 1 year ago

Hi, I used the example caddy config from here https://docs.netmaker.org/server-installation.html#caddy opening the home page, clicking all the pages work fine. However on any page that is not the home page, a refresh would give 404. Any idea what's the cause?

`{
        email email@gmail.com
}

\# Dashboard
https://dashboard.netmaker.foobar.com {
        # Apply basic security headers
        header {
                # Enable cross origin access to *.netmaker.foobar.com
                Access-Control-Allow-Origin *.netmaker.foobar.com
                # Enable HTTP Strict Transport Security (HSTS)
                Strict-Transport-Security "max-age=31536000;"
                # Enable cross-site filter (XSS) and tell browser to block detected attacks
                X-XSS-Protection "1; mode=block"
                # Disallow the site to be rendered within a frame on a foreign domain (clickjacking protection)
                X-Frame-Options "SAMEORIGIN"
                # Prevent search engines from indexing
                X-Robots-Tag "none"
                # Remove the server name
                -Server
        }
    root * /var/www/netmaker
    file_server

  log {
    output file /var/log/caddy/dashboard-access.log
  }
}

\# API
https://api.netmaker.foobar.com  {
        reverse_proxy http://127.0.0.1:8081
}

\# MQ
wss://broker.netmaker.foobar.com {
        reverse_proxy ws://127.0.0.1:8883
`