Want to subscribe to topics you're interested in?
Become a Member

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,379
    287
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +713
    Local Time:
    1:47 PM
    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

    36,361
    7,984
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,293
    Local Time:
    3:47 AM
    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
..