配置https证书
- 找到目录
/alidata/server/nginx/conf
下的nginx.conf
文件,文件内容如下
user www www; worker_processes 2; error_log /alidata/log/nginx/error.log crit; pid /alidata/server/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 65535; events { use epoll; worker_connections 65535; } http { include mime.types; default_type application/octet-stream; #charset gb2312; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; #limit_zone crawler $binary_remote_addr 10m; log_format '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include /alidata/server/nginx/conf/vhosts/*.conf; }
其实只要改最底下那句就行
include /alidata/server/nginx/conf/vhosts/*.conf;
把vhost的配置指向nginx/conf/vhosts
里面的所有conf结尾文件,其实就是配置域名证书的配置文件,我这里的配置了几个域名文件目录接口如下
- 然后就是把下载的证书文件放置到
nginx/conf/cert
目录下面,如下图所示
- 然后看看第一张图片的conf配置文件内容
server { listen 80; server_name www.bigmantech.cn; index index.html index.htm index.php; root /alidata/www/default/; location ~ ^(.+\.php)(.*)$ { fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } #伪静态规则 include /alidata/server/nginx/conf/rewrite/default.conf; location / { index index.html index.htm index.php; #autoindex on; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } access_log /alidata/log/nginx/access/default.log; } server { listen 443 ssl; server_name www.bigmantech.cn; ssl_certificate cert/www.bigmantech.cn.pem; ssl_certificate_key cert/www.bigmantech.cn.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { proxy_pass http://www.bigmantech.cn; } }
4 .最后重启nginx就行,执行以下命令
nginx -s reload
然后用https去访问域名能正常访问就行
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Java中的阻塞队列(1)
队列(Queue):FIFO 双端队列(Deque):两端都可以进出,当我们约束从队列的一端进出队列时,就形成了一种存取模式,它遵循先进后出的原则,就是所谓栈结构 阻塞队列(BlockingQueue):在队列的基础上附加了两个操作,1:在队列为空时,获取元素的线程会等待队列变为非空;当队列满时,存储元素的线程会等待队列可用,阻塞队列常用于生产者和消费者场景 1、阻塞队列:BlockingQueue(T),所有的阻塞队列的父接口 首先是接口的继承关系如图1-1,这里可以清楚的看到BlockingQueue队列其实本质上可以认为是一个集合 图1-1 常用方法: (1):add,添加到队列里面,如果可以容纳,返回true,否则直接抛出异常 (2):offer,表示将元素添加到队列中,可以容纳返回true,否则返回false (3):put,把元素添加到队列,如果没有空间,则阻塞线程 (4):poll,取走排在首位的对象,如果不能立即取走,则等待入参的时间,到时直接返回null (5):take,取走排在首位的对象,如果为空,则阻塞队列,直到有新的对象被加入 注意:B...
- 下一篇
给JAVA程序员自己的一个书单
从事开发工作已经四年,前两年感觉自己成长挺快的,能独立完成需求,最近两年感觉自己越来越颓废,喜欢把时间浪费在直播这种没意义的事情上。 给自己一个书单,给自己一点压力,希望以后的自己越来越好。 技术日新月异,对于选择开发的我们来说,真的是不进则退,希望我们 stay hungry stay foolish。 大型网站技术架构 核心原理与案例分析 已读完 读书笔记 深入分析Java Web技术内幕 已读完 Spring实战 Spring4.x企业应用实战 鸟哥的Linux。 高性能MYSQL 深入Java虚拟机 白帽子将Web安全 大型网站系统与JAVA中间件 已读完 读书笔记 JAVA性能权威指南 Redis设计与实现 程序员修炼之道:丛小工到专家 Java 8实战 数学之美 浪潮之巅 亿级流量网站架构核心技术 SQL必知必会 已读完 编写高质量代码 改善Java程序的151个建议 已读完 Java与模式 大话设计模式 设计模式之禅
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
-
Docker使用Oracle官方镜像安装(12C,18C,19C)
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS8编译安装MySQL8.0.19
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- MySQL8.0.19开启GTID主从同步CentOS8
- CentOS7,8上快速安装Gitea,搭建Git服务器
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
推荐阅读
最新文章
- MySQL8.0.19开启GTID主从同步CentOS8
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2整合Redis,开启缓存,提高访问速度
- Windows10,CentOS7,CentOS8安装Nodejs环境
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- Docker安装Oracle12C,快速搭建Oracle学习环境
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- CentOS7设置SWAP分区,小内存服务器的救世主