Learn about Centmin Mod LEMP Stack today
Register Now

Nginx error_page Question

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Jimmy, May 26, 2016.

  1. Jimmy

    Jimmy Well-Known Member

    1,793
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +993
    Local Time:
    9:02 PM
    I'm trying to modify the errorpage.conf to point to a dynamic link vs. the error pages in Centmin Mod.

    Using 403 as an example.


    I'm trying to send the error page to this link: https://10.0.0.123/403 I can easily do that with the code below:

    Code:
    error_page 403 = https://10.0.0.123/403;
    The problem is that it shows up in the browser location bar as https://10.0.0.123/403 when I would like it not to show.

    I tried what is below but it didn't work.

    Code:
    error_page 403 = https://10.0.0.123/403;
    
    location = https://10.0.0.123/403 {
    access_log              off;
    internal;
    }
    If anyone has any ideas on how I can make this work, please let me know.

    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:02 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    i believe error_page only accepts relative paths not absolute urls so location = /403 but seems you can actually Module ngx_http_core_module
     
    Last edited: May 26, 2016