Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Default routing seems broken (nginx 404 errors) #144

Closed
@mattpetrie

Description

@mattpetrie

Hi @mars 😃 !!

I think the readme section that covers configuring nginx routing in static.json could be clarified a bit to emphasize the need to include a "routes" configuration in to avoid nginx 404 responses for non-root routes.

The readme frames the issue in the context of avoiding use of hash-based URLs. What the readme doesn't make clear is that when using "real" URLs, you will get a 404 response from nginx for all non-root URLs if you don't add a routes config to your static.json. In other words, the need to include this configuration exists regardless of whether you are using hash-based routes or not.

Given that it has become increasingly common to use real URLs from the beginning of a project (such as with react-router-dom's BrowserRouter, and getting the 404 page for route that is expected to exist is a pretty serious failure, perhaps it would be good to update the documentation to place more emphasis on needing to add routes to static.json to avoid this pitfall?

When reading the readme I had skipped over the Routing clean URLs section because I was already using real URLs so I assumed it did not apply to my use case, when in fact it was still important for me to add the route config. It also looks like I'm not the first to run into this from misreading the docs.

Happy to submit a suggested change if that helps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions