question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation needed: client side only + nginx + server returning 404 responses

See original GitHub issue

We need to supplement existing v4 documentation to add a quite elementary and common case: client-side (normal) rendering via v4 react-router, returning 404 server error, on custom styled error pages, on nginx.

I trawled many issues (like #3210) and it looks like everybody are rendering server-side or issues get closed too soon to allow meaningful discussion to reach the client-side rendering 404 error codes, or examples are outdated.

What about routing and responding with 404 server errors on client-side rendering web apps on Nginx?

It looks like I the only one on the Internet wanting to make Google-friendly web apps with custom, styled and meaningful 404 error pages returning correct error codes, and do it with minimal effort (client-side rendering using react-router (no fluxible, reduxible or whatnot), on create-react-app) 😀

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kerimdzhanovcommented, Aug 19, 2017
0reactions
abhionlyonecommented, May 17, 2018

In case someone is still looking for a configuration in Nginx:

location / {
  try_files $uri /index.html;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoiding the Top 10 NGINX Configuration Mistakes
We help you avoid the 10 most common NGINX configuration errors, explaining the problems caused by each and how to fix them.
Read more >
How To Configure Nginx to Use Custom Error Pages on ...
Open the server block file in the /etc/nginx/sites-enabled directory that you wish to configure. We will use the default server block file ...
Read more >
404 Not Found Error: What It Is and How to Fix It - Airbrake Blog
Some web applications "fake" 404 Not Found Errors when requesting an invalid resource. The server returns a standard 200 OK response code, which ......
Read more >
Deploy single page application Angular: 404 Not Found nginx
This is a problem with the server side not the Angular side of things . It is the servers responsibility to return ......
Read more >
How To Properly Serve 404 Errors on SPAs (with SEO in Mind)
You will need to add a block of config code that explicitly returns a 200 only for your listed URLs. Here's an example...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found