博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx更改Error页面404等等页面指向
阅读量:2072 次
发布时间:2019-04-29

本文共 2902 字,大约阅读时间需要 9 分钟。

改动nginx.conf下的http-server下的error_page 即可

效果如图

#user  nobody;worker_processes  1;#error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '    #                  '$status $body_bytes_sent "$http_referer" '    #                  '"$http_user_agent" "$http_x_forwarded_for"';    #access_log  logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   html;            index  index.html index.htm;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   404 500 502 503 504  /ErrorPage.html;        location = /ErrorPage.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        #location ~ \.php$ {        #    root           html;        #    fastcgi_pass   127.0.0.1:9000;        #    fastcgi_index  index.php;        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;        #    include        fastcgi_params;        #}        # deny access to .htaccess files, if Apache's document root        # concurs with nginx's one        #        #location ~ /\.ht {        #    deny  all;        #}    }    # another virtual host using mix of IP-, name-, and port-based configuration    #    #server {    #    listen       8000;    #    listen       somename:8080;    #    server_name  somename  alias  another.alias;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}    # HTTPS server    #    #server {    #    listen       443 ssl;    #    server_name  localhost;    #    ssl_certificate      cert.pem;    #    ssl_certificate_key  cert.key;    #    ssl_session_cache    shared:SSL:1m;    #    ssl_session_timeout  5m;    #    ssl_ciphers  HIGH:!aNULL:!MD5;    #    ssl_prefer_server_ciphers  on;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}}
Error

We're sorry, but something went wrong.

The issue has been logged for investigation. Please try again later.

Technical details for the administrator of the website

This website is powered by Passenger® , a rock-solid, feature-rich web application server that integrates with Apache and Nginx.

 

转载地址:http://qupmf.baihongyu.com/

你可能感兴趣的文章
深度学习在自然语言处理中的应用全景图-上
查看>>
导读:如何通关自然语言处理面试
查看>>
R in Action 学习笔记 - 第九章-常用R函数
查看>>
R in Action 学习笔记 - 第九章-Analysis of Variance
查看>>
R in Action 学习笔记-边学边查
查看>>
边听边记-创业分子-互联网颠覆医疗
查看>>
边听边记-财经郎眼-国企改革 大风已起 151026
查看>>
【LEETCODE】ADD DIGITS
查看>>
【LEETCODE】104-Maximum Depth of Binary Tree
查看>>
数据结构-树-学习笔记
查看>>
【LEETCODE】100-Same Tree
查看>>
【LEETCODE】226-Invert Binary Tree
查看>>
【LEETCODE】111-Minimum Depth of Binary Tree
查看>>
【LEETCODE】235-Lowest Common Ancestor of a Binary Search Tree
查看>>
【LEETCODE】110-Balanced Binary Tree
查看>>
【LEETCODE】101-Symmetric Tree
查看>>
【LEETCODE】257-Binary Tree Paths
查看>>
【LEETCODE】102-Binary Tree Level Order Traversal
查看>>
【LEETCODE】107-Binary Tree Level Order Traversal II
查看>>
数据结构-stack-学习笔记
查看>>