Discover Centmin Mod today
Register Now

Nginx error_page Question

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

  1. Jimmy

    Jimmy Premium Member Premium Member

    1,423
    294
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +728
    Local Time:
    4:14 AM
    1.13.x
    MariaDB 10.1.x
    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

    37,319
    8,154
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,552
    Local Time:
    7:14 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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
    • Informative Informative x 1
..