nginx配置后出现的问题

2019-01-02 23:43发布

 

 

为什么IP访问和域名访问效果不一样????????

标签: nginx
1条回答
虎瘦雄心在
2楼-- · 2019-01-03 00:40

你要跳一下啊

#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;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
    upstream www.wzpbk.com {
            server localhost:8080;
    }
    
    server {
        listen       80;
        server_name  www.wzpbk.com;
        #rewrite ^ https://$http_host$request_uri? permanent;
        return 301 https://$http_host$request_uri;
    }
server {
    listen 443;
    server_name www.wzpbk.com;
    ssl on;
    root html;
    index index.html index.htm;
    ssl_certificate   cert/111111.pem;
    ssl_certificate_key  cert/22222.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    location / {
        root html;
    proxy_pass http://www.wzpbk.com;
        index index.html index.htm;
    }
}
    


}

这是我的配置文件分享给你

查看更多
登录 后发表回答