React web app routes not working with query string by using nginx

Bite Code
Published on May, 10 2024 1 min read 1 comments
image

I am trying to host my react website using nginx. everything works fine except the routes having query string.

location / {
    try_files $uri /index.html;
}
http:// example.com                          //works fine
http:// example.com/courses                  //works fine
http:// example.com/courses?type=software    //not working shows blank page.
http:// example.com/courses?type=software&institute=xyz    //not working shows blank page.

Please help me. Thank you

1 Answers

Mahabubur Rahman May 11, 2024 - 06:37 PM