0

How to redirect all the sub directory path to single index.html file?

here is what i want nginx configuration:

location /user/* {
    alias /home/vishant/devcenter/baetter-share1;
    index index.html;
}

this means if i hit /user OR /user/vishant OR /user/xyz/vishant it should render only index.html page.

The code i have written is not working but what i thought should be similar to this.

1 Answer 1

3
location /user/ {
    root /home/vishant/devcenter/baetter-share1;
    try_files /index.html =404;
}

Documentation:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.