Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8000231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:43:38+00:00 2026-06-04T15:43:38+00:00

I set up custom error pages in nginx with fastCGI for PHP like this

  • 0

I set up custom error pages in nginx with fastCGI for PHP like this way and it works:

root <FOLDER>;
error_page 404 /error.php?404;
location = /error.php {
    include /etc/nginx/fastcgi.conf;
    fastcgi_pass  127.0.0.1:1234;
    root  <FOLDER>;
}

But since I have one error.php for every HTTP error codes, I wanted to set up in a general form. The problem is that I don’t know if nginx provide the error code to be passed by GET to error.php

I am looking for something like:

root <FOLDER>;
error_page 500 501 502 401 402 403 404 /error.php?NGINX_ERROR_CODE;
location = /error.php {
    include /etc/nginx/fastcgi.conf;
    fastcgi_pass  127.0.0.1:1234;
    root  <FOLDER>;
}

The problem is NGINX_ERROR_CODE which I don’t know if it provides such a thing to set up general error_page handler.

Is it any way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:43:39+00:00Added an answer on June 4, 2026 at 3:43 pm

    Googling around, it doesn’t initially appear that there’s a var for it.

    You can, however, set multiple error page directives.

    error_page 401 /error.php?e=401;
    error_page 402 /error.php?e=402;
    error_page 403 /error.php?e=403;
    error_page 404 /error.php?e=404;
    error_page 500 501 502 /error.php?e=50x;
    

    and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php web page that now uses custom error pages when a
We have set a custom 404 error page in order to display a 'nice'
I've got customErrors set in my web.config <customErrors mode=On defaultRedirect=/Error/GeneralError> <error statusCode=404 redirect=/Error/NotFound/> </customErrors>
How to set a custom log format for nginx, so that request got parsed
I am trying to add custom error pages to my web application. So far
I have a custom error page set up for my application: <customErrors mode=On defaultRedirect=~/errors/GeneralError.aspx
I have a custom error page that should display for HTTP 404 errors. It
good evening, how to set custom error OR prevent page damage when display_errors=0 AND
I'm trying to setup custom error pages. I put the pages in /error/ in
How to set custom header logo on your Track Wiki project page? How to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.