nginx 常用配置

80转443:

server {
        listen 80;
        server_name huashengshu.top;
        rewrite ^(.*)$ https://${server_name}$1 permanent; 
    }

 404报错:

http {
     proxy_intercept_errors on;      ##不加此项,后面开启了404也无法跳转

server {

  ... ....
  error_page
404 /404.html; ##404跳转     location = /404.html {     root /etc/nginx/html/404;   } } }

 

posted @ 2020-12-28 09:03  每日一坑  阅读(94)  评论(0编辑  收藏  举报