How to redirect 404 to deafult index.html?

Hi,

WhenI use http://127.0.0.1/ the nginx default index.html is shown.
I need to redirect;

    http://127.0.0.1/admin redirect to 127.0.0.1:1024 and

        http://127.0.0.1/user redirect to 127.0.0.1:3000

rest of it including 404 must be redirect to http://127.0.0.1/index.html

my index.html it is in /user/shared/nginx/html folder.

How can I use proxy_pass?

Does your question have something (anything) to do with using the Let’s Encrypt services? Because it doesn’t sound like it does.

You may right. But I lost all my configuration that I made 9 months ago and forget all of them. I use certbot to renew my certificate. Have no idea last time (2 weeks ago) when renew my certificate the redirect proxy_pass stop working. When I add as a new issue in github certbot I get reply to write here.

I need to set my config so I can run certbot to install my certificate.

If this is not a place to ask, do you know where I can a information about my post?

Thanks

Hi @NTMS2017,

Please view some of the following articles from a Google search that can help with your nginx configuration. Early in my career when I was coming up I found the Digital Ocean guides to be very helpful.

Best of luck out there!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.