欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

一个 ok 的 nginx 的 虚拟主机配置 这里 是 http 自动跳转 https 有大用 有大大用 有大大大用

server {

        listen       80;
        root /home/wwwroot/weixinxiao_shipingzhong_cn/public_html;
        server_name weixinxiao.shipingzhong.cn;
        rewrite ^(.*)$  https://$host$1 permanent;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 internal;
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}
 
server {
        listen       443;
        root /home/wwwroot/weixinxiao_shipingzhong_cn/public_html;
        ssl                  on;
        ssl_certificate      cert/weixinxiao.shipingzhong.cn.crt;
        ssl_certificate_key  cert/weixinxiao.shipingzhong.cn.key;
        ssl_prefer_server_ciphers on;
        ssl_session_timeout 10m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
        server_name weixinxiao.shipingzhong.cn;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
            deny  all;
    }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 internal;
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}
 
        
普通分类: