I have a static website with Next-Js export, and my Nginx setting is like -
server {
server_name www.example.com;
root /var/www/example;
index index.html index.htm;
location / {
try_files $uri $uri.html /$uri /index.html;
}
listen 80;
}
This works well but I can not get a 404 error page if we manually update the wrong URL on the client side.
Can anyone explain how to get an error 404 page for not matching URL.
For now, if a manually update URL on the browser, the same page opens which was opened from before.
Thanks