开发者社区> 问答> 正文

nginx 安装ssl证书后,访问是welcome to openresty 页面,网站页面不能打开

环境:centos 6.8+php+nginx 问题:nginx 部署安装 ssl证书后,访问https://域名 ,不能显示网站页面,一直跳转到 welcome to openresty! 欢迎界面 说明: 1. nginx.conf 配置文件 如下: user root www; worker_processes auto;

error_log /var/log/nginx/error.log crit; pid /var/run/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 65532; events { use epoll; accept_mutex off; multi_accept on; worker_connections 65532; } http { #其他参数

include vhosts/*.conf; }

  1. vhosts/default.conf 配置如下:

server { listen 80; server_name 域名; return 301 https://$server_name$request_uri;

location / {
    if (!-e $request_filename) {
    rewrite ^/(.*)$ /index.php/$1 last;
    }
    index index.php index.html index.htm;
}

location ~ ^/shopadmin {
    rewrite ^/(.*)$ /index.php/$1 last;
    break;
}


location ~ .*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$
{
    expires       30d;
}


location ~ .*\.php.*
{
    include php_fcgi.conf;
    include pathinfo.conf;
}


location ~* \.(ini|sql|conf|bak)$ {
     return 404;
}

location ~* ^/(themes|images|logs|data|demo|wap_themes)/.*\.(php|php5)$ {
    deny all;
}

location ~ /\.(svn|git|)/ {
   deny all;
}

location ~ .*\.(js|css)?$
{
    expires      1h;
}
access_log /var/log/nginx/access.log access;
#access_log off;

}

server { listen 443 ssl; server_name 域名; add_header X-Content-Type-Options nosniff; ssl_certificate /usr/local/nginx/cert/证书名称.pem; ssl_certificate_key /usr/local/nginx/cert/证书名称.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on;

location ~ .php{ root /data/httpd/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/httpd/$fastcgi_script_name; fastcgi_split_path_info ^(.+.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; fastcgi_param HTTPS on; }

}

展开
收起
游客7nky7b4i2mff4 2019-08-10 14:22:55 9521 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载