404 default error page Nginx

Discussion in 'Server Operation' started by Pyxis, Dec 11, 2018.

  1. Pyxis

    Pyxis New Member

    Hi all,
    I have 1 question:
    My default example vhost in ispconfig 3.1 with nginx vm is this:
    server {
    listen *:80;

    listen *:443 ssl;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_certificate /var/www/clients/client1/web1/ssl/001-default.studiopyxis.it-le.crt;
    ssl_certificate_key /var/www/clients/client1/web1/ssl/001-default.studiopyxis.it-le.key;

    server_name 001-default.studiopyxis.it www.001-default.studiopyxis.it;

    root /var/www/001-default.studiopyxis.it/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/001-default.studiopyxis.it/error.log;
    access_log /var/log/ispconfig/httpd/001-default.studiopyxis.it/access.log combined;

    location ~ /\. {
    deny all;
    }

    location ^~ /.well-known/acme-challenge/ {
    access_log off;
    log_not_found off;
    root /usr/local/ispconfig/interface/acme/;
    autoindex off;
    index index.html;
    try_files $uri $uri/ =404;
    }

    location = /favicon.ico {
    log_not_found off;
    access_log off;
    expires max;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    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/web1/web//stats/.htpasswd_stats;
    }

    location ^~ /awstats-icon {
    alias /usr/share/awstats/icon;
    }

    location ~ \.php$ {
    try_files /bd481e914cb5480c90cc27b792938fac.htm @php;
    }

    location @php {
    try_files $uri =404;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/lib/php7.2-fpm/web1.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_intercept_errors on;
    }

    location / {
    try_files $uri $uri/ /index.php?$args;
    }
    --------------------------------------------------------------------------------------------------------------------------------------

    How can I edit it for solve the problem of 404 error page default that responds everytime I go to an undesired url??
    With apache my wordpress websites go to 404 error page of the theme, but with nginx all the permalinks that no exist go to default 404..for example my /phpmyadmin page..

    thanks
     
  2. Pyxis

    Pyxis New Member

    any idea??
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Uncheck the 'custom error pages' checkbox in the website settings of that site in ISPConfig.
     
  4. Pyxis

    Pyxis New Member

    very thanks
     

Share This Page