首页 > Web开发 > 详细

Nginx, HTTPS的配置

时间:2017-08-23 16:14:18      阅读:398      评论:0      收藏:0      [点我收藏+]

server {
listen 443;      ####HTTPS指定端口
server_name www.web.com;      #####域名或者IP

root /data/wwwroot/laravel/public;           #####项目所在绝对路径,项目入口
index index.php index.html index.htm ;

########################################################
## HTTPS ##
ssl on;

ssl_certificate /usr/local/nginx/cert/214235201250226.pem;
ssl_certificate_key /usr/local/nginx/cert/214235201250226.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;
#########################################################

try_files $uri $uri/ @rewrite;

location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}

location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}

location ~ [^/]\.php(/|$) {
# fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;

####################################################
## HTTPS ##
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
####################################################

include fastcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
# access_log off;
}

location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}

}

Nginx, HTTPS的配置

原文:http://www.cnblogs.com/mzxl1987/p/7418705.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!