Welcome! Log In Create A New Profile

Advanced

Re: Nginx 404 redirection to error page

Francis Daly
April 09, 2022 02:34AM
On Fri, Apr 08, 2022 at 05:44:08PM +0530, Dhanushka Parakrama wrote:

Hi there,

> when it try to access non existing page such as https://example.com/abc
> , then from nginx page correctly get redirect to the
> *https://example.com/page-not-found

> But when i try to access non non-existing page ( with extension ) such as
> https://example.com/*abc.js * it does not get redirected to the
> *https://example.com/page-not-found

What is your config? As in:

* in which location{} is the request /abc.js handled? What is the
error_page directive there, and what handler ("something_pass" directive,
usually) is there?

* in which location{} is the request /abc handled? What is the
error_page directive there, and what handler ("something_pass" directive,
usually) is there?

> So is there any way to fix this issue? , please advice

Maybe "fastcgi_intercept_errors on;" will help, if you are using
fastcgi_pass.

http://nginx.org/r/fastcgi_intercept_errors

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Nginx 404 redirection to error page

Dhanushka Parakrama April 08, 2022 08:18AM

Re: Nginx 404 redirection to error page

Francis Daly April 09, 2022 02:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready