Redirect Nginx 404';s是';不工作-他们只是刷新页面

Redirect Nginx 404';s是';不工作-他们只是刷新页面,redirect,nginx,http-status-code-404,Redirect,Nginx,Http Status Code 404,如果您直接输入我的404页面,它的加载效果非常好,但是当您在浏览类似(不存在)的页面时出现404错误时,它会刷新页面。。就像我在打字一样 这是我的配置 server { listen 80; listen 443; default_type text/html; location / { root /usr/share/nginx/html; index index.php index.html index.ht

如果您直接输入我的404页面,它的加载效果非常好,但是当您在浏览类似(不存在)的页面时出现404错误时,它会刷新页面。。就像我在打字一样

这是我的配置

server {
    listen   80;
    listen   443;
    default_type text/html;  

    location / {
    root   /usr/share/nginx/html;
            index  index.php index.html index.htm;
            try_files $uri $uri/ /index.php;
    }

    root /usr/share/nginx/html;
    index index.php index.html index.htm;

    server_name epicmc.us;

    error_page 404 /usr/share/nginx/html/404.php;

    error_page 500 502 503 504 /50x.php;
    location = /50x.html {
          root /usr/share/nginx/html;
    }

    # pass the PHP scripts to FastCGI server listening on the php-fpm socket
    location ~ \.php$ {
            try_files $uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
    }
}

错误\u页面
最后一个值不是文件系统路径。它是nginx执行内部重定向的URI应该适合您。