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 7082541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:04:00+00:00 2026-05-28T07:04:00+00:00

I’m working on a website, and if the user isn’t authenticated or doesn’t have

  • 0

I’m working on a website, and if the user isn’t authenticated or doesn’t have permission to view the specified page, I want to throw the standard 404 page. I’ve done a little bit of looking, but no luck. Obviously I could just copy the HTML, but I’d rather not. I’d rather use the actual 404 page that nginx uses, if possible.

Where can I find this?

  • 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-05-28T07:04:01+00:00Added an answer on May 28, 2026 at 7:04 am

    Run nginx -V and look for the path defined by --prefix=/prefix/path/to/nginx.

    You will find the default 404 file as 404.html under /prefix/path/to/nginx/html

    A better way to editing the default file when you want custom error pages is to add a block such as this to your nginx.conf file under the http section

    error_page 400 /error_docs/400_bad_request.html;
    error_page 401 /error_docs/401_unauthorized.html;
    error_page 403 /error_docs/403_forbidden.html;
    error_page 404 /error_docs/404_not_found.html;
    error_page 405 /error_docs/405_method_not_allowed.html;
    error_page 406 /error_docs/406_not_acceptable.html;
    error_page 407 /error_docs/407_proxy_authentication_required.html;
    error_page 412 /error_docs/412_precondition_failed.html;
    error_page 415 /error_docs/415_unsupported_media_type.html;
    error_page 500 /error_docs/500_internal_server_error.html;
    error_page 501 /error_docs/501_not_implemented.html;
    error_page 502 /error_docs/502_bad_gateway.html;
    error_page 504 /error_docs/504_gateway_timeout.html;
    

    This basically says use /error_docs/404_not_found.html if a 404 error is generated. You obviously define those for which you want to make a specific custom page

    You can then save the 404_not_found.html file somewhere on your server such as /prefix/path/to/nginx/errors and then, under each server section, add something like

    server {
    
        ...
    
        location /error_docs {
            internal;
            alias /prefix/path/to/nginx/errors;
        }
    
        ...
    
    }
    

    Whenever any of the previously defined error codes are thrown, the predefined custom page will be served.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.