server {
Listen 443; # # #HTTPS指定端口
server_name www.web.com; # # # #域名或者IP
Root/data/wwwroot/laravel/public; # # # #项目所在绝对路径, project portal
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 configuration