配置https域名
1、申請ssl證書
xxx.crt xxx.keycrt
-----BEGIN CERTIFICATE----- xxx -----END CERTIFICATE-----key
-----BEGIN PRIVATE KEY----- xxx -----END PRIVATE KEY-----2、將crt、key文件放入
/usr/local/nginx/conf目錄下。
3、開啟443端口
4、配置nginx
server{#使用443端口listen 443 ssl;#listen 80;server_name a.jq.com;root /home/wwwroot/default/jq;ssl_protocols TLSv1.2 TLSv1.1 TLSv1;#證書文件ssl_certificate a.jq.com.crt;#私鑰文件ssl_certificate_key a.jq.com.key;ssl_prefer_server_ciphers on;... } server{listen 443 ssl;index index.html index.htm index.php;server_name www.a.com;root /home/wwwroot/default/a/Public;include enable-php-pathinfo.conf;ssl_protocols TLSv1.2 TLSv1.1 TLSv1;ssl_certificate a.crt;ssl_certificate_key a.key;ssl_prefer_server_ciphers on;location /nginx_status{stub_status on;access_log off;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 12h;}location ~ /\.{deny all;}access_log /home/wwwlogs/a/access.log; }5、重啟nginx生效
轉載于:https://www.cnblogs.com/jiqing9006/p/10972129.html
總結
- 上一篇: 【搜索引擎】全文索引数据结构和算法
- 下一篇: XposedNoRebootModule