UNSOLVED SOLVED: Doc Page: Configure Nginx for custom error


  • Can someone let me know what I am missing here. I have tried and tried to have nginx redirect errors to my own pages or to the top of the site but no matter what I do, nodebb is always handling the error.

     /sdxasx Not Found
    You seem to have stumbled upon a page that does not exist. Return to the home page.
    

    Nginx does kick in with the 502 custom page but nothing else. Everything else seems to be handled by nodebb.

  • Global Moderator Plugin & Theme Dev

    What exactly have you tried? According to this you need to enable proxy_intercept_errors and set the error_page.


  • @pitaj Hi,

    I've tried all the usual nginx methods to redirect but I think I'm not very familiar with using it as a reverse proxy and that is probably where I'm doing something wrong. From what you're showing me, it's because I have not included 'proxy_intercept_errors'.

    The reason I'm trying to do this is I converted my board from phpbb and there are a lot of links which end up being 404 so I'd like to send all 404's to the top page.


  • This seems to work.

    #        error_page 404 /404.html;
    #        location = /40x.html {
    #        }
    
            error_page 404 /;
            proxy_intercept_errors on;
            proxy_redirect off;
    

    I'm not sure if this is the correct way to implement it because different articles seem to show variations on the directives but it works.

    Thank you for your input on this.

Suggested Topics

| |