how can i config NGINX to show custom 404 error page, for only one of my clients on kloxo panel?i made a " custom_404.html " file in root directory of domain and i found "Domainname.com.conf " file in this path : /opt/configs/nginx/conf/domains/ .
then i added this command :
error_page 404 /custom_404.html;
location = /custom_404.html {
root /usr/share/nginx/html;
internal;
}
to end of every functions that starts with "server" statement , in the file like this :
## cp for 'mydomainname.com'
server {
#disable_symlinks if_not_owner;
include '/opt/configs/nginx/conf/globals/listen_nonssl.conf';
include '/opt/configs/nginx/conf/globals/gzip.conf';
add_header X-Content-Type-Options "nosniff"
;
add_header X-XSS-Protection "1;mode=block"
;
add_header X-Frame-Options "SAMEORIGIN"
;
add_header Access-Control-Allow-Origin "*";
add_header X-Supported-By "Kloxo-MR 7.0";
server_name cp.mydomain.com;
include '/opt/configs/nginx/conf/globals/acme-challenge.conf';
index index.php index.shtml index.pl index.py index.cgi index.rb Default.aspx Default.asp index.html index.htm default.htm welcome.html;
set $var_domain 'cp.mydomain.com';
set $var_rootdir '/home/kloxo/httpd/cp';
root $var_rootdir;
set $var_user 'apache';
set $var_fpmport '50000';
set $var_phpselected 'php';
#include '/opt/configs/nginx/conf/globals/switch_standard.conf';
include '/opt/configs/nginx/conf/globals/php-fpm_standard.conf';
error_page 404 /custom_404.html;
location = /custom_404.html {
root /usr/share/nginx/html;
internal;
}
}
then :
sh /script/restart-web -y
but nothing happens and kloxo 404 error page is showing up.
and after
sh /script/fixweb
the edited "Domainname.com.conf " will delete added script tho file.
any helps please!?