Skip to content

Support single page applications #23

@cescoferraro

Description

@cescoferraro
    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to redirecting to index.html
        try_files $uri $uri/ @root;
    }

    # If nginx can't find a file, fallback to the homepage.
    location @root {
        rewrite .* / redirect;
    }

The fallback is not actually redirecting to index.html. This is actually sending a 302 to the root.
I have not tested this yet, but I think we need to say

try_files $uri $uri/ /index.html;

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