环境: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; }
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; }
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。