Nginx, HTTPS的配置
server {
listen 443; ? ? ?####HTTPS指定端口
server_name www.web.com; ? ? ?#####域名或者IP
root /data/wwwroot/laravel/public; ? ? ? ? ? #####項(xiàng)目所在絕對(duì)路徑,項(xiàng)目入口
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)?$ {http://078886.cn/
expires 7d;
access_log off;
}
}
轉(zhuǎn)載于:https://www.cnblogs.com/qwangxiao/p/7418768.html
總結(jié)
以上是生活随笔為你收集整理的Nginx, HTTPS的配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: okHttp通信
- 下一篇: Nginx —— 检查配置文件ngi