码迷,mamicode.com
首页 > Web开发 > 详细

Nginx, HTTPS的配置

时间:2017-08-23 16:22:48      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:www.   html   fast   res   list   flv   deny   fastcgi   ati   

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的配置

标签:www.   html   fast   res   list   flv   deny   fastcgi   ati   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!