How to disable "error_page" Nginx directive

Discussion in 'Installation/Configuration' started by blax, Oct 26, 2015.

  1. blax

    blax New Member

    Hello,
    I need to disable "error_page" directive for a website under Nginx from Ispconfig panel. I've seen that this directive is enabled by default, because it is inside the Virtual Host configuration file (/etc/nginx/sites-available/WEBSITE_NAME.vhost ), so I need to know the code to use to override this directive from Ispconfig panel, under Website Options tab.

    Thank you.

    Roberto
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is just one setting dealing with error pages in the website settings in ispconfig, the name is "custom error pages", you can't miss it.
     
  3. blax

    blax New Member

    I checked the Vhost configuration file of my website (/etc/nginx/sites-available/MY-WEBSITE.vhost) and there is not such directive "custom_error_pages" inside it, there are instead lots of directives named "error_page", and those are the ones I need to disable from Ispconfig panel.

    FYI my version of Ispconfig is 3.0.5.4p8

    Here is the content of my Vhost file:

    Code:
    server {
            listen *:80;
    
    
            server_name MYWEBSITE.COM www.MYWEBSITE.COM;
    
            root   /var/www/MYWEBSITE.COM/web;
    
    
    
            index index.html index.htm index.php index.cgi index.pl index.xhtml;
    
    
    
            error_page 400 /error/400.html;
            error_page 401 /error/401.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 405 /error/405.html;
            error_page 500 /error/500.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            recursive_error_pages on;
            location = /error/400.html {
    
                internal;
            }
            location = /error/401.html {
    
                internal;
            }
            location = /error/403.html {
    
                internal;
            }
            location = /error/404.html {
    
                internal;
            }
            location = /error/405.html {
    
                internal;
            }
            location = /error/500.html {
    
                internal;
            }
            location = /error/502.html {
    
                internal;
            }
            location = /error/503.html {
    
                internal;
            }
    
            error_log /var/log/ispconfig/httpd/MYWEBSITE.COM/error.log;
            access_log /var/log/ispconfig/httpd/MYWEBSITE.COM/access.log combined;
    
            location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
            }
    
            location = /favicon.ico {
                log_not_found off;
                access_log off;
            }
    
            location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
            }
    
            location /stats/ {
    
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web2/web/stats/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /8ec913c4264269b16b40d062c042fb3f.htm @php;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php5-fpm/web2.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
    
    
    
    
    
    
    }
    
     
  4. blax

    blax New Member

    I'm sorry I didn't understand you meant that "custom error pages" was inside Ispconfig panel. Now I've found the correct option that manages custom error pages (it is named "Own Error-Documents") and I disabled it, and now all "error_page" directives are disappeared from configuration file.

    Thank you very much for your help. ;-)
     

Share This Page