网站渗透

黑客攻防,ddos攻击,中国红客联盟,攻击服务器,黑产,拿站

腾讯云https证书申请(腾讯云免费申请https证书)

今天把项目的https配置完成。下面是具体的配置步骤

1.下载

Linux:CentOS 7.2 64位

Nginx:nginx-1.13.1

安装目录:/opt/nginx/

wget http://nginx.org/download/nginx-1.13.1.tar.gzan

2.安装

1:安装相关依赖

1.gcc、gcc-c++yum install gcc yum install gcc-c++2.pcre 、zilbyum -y install pcre*yum -y install zlib*3.因为这次主要是配置https所以添加opensslyum -y install openssl yum -y install openssl-devel

2、安装Nginx

(1) 解压安装包

tar -z -xv -f nginx-1.13.1.tar.gz

(2) 编译

cd nginx-1.13.1 #进入nginx./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre参数说明:--prefix:设置安装路径 --with-http_stub_status_module:支持nginx状态查询--with-http_ssl_module:支持https--with-pcre:为了支持rewrite重写功能,必须制定pcre

(3) 安装

make make install

(4) 启动

/opt/nginx/sbin/nginx -c /opt/nginx/nginx-1.13.1/conf/nginx.conf

(5) 页面

访问 http://域名/

三、配置文件

这一步最重要,上面的按照顺寻安装基本上都没有什么问题

#user nobody;worker_processes 1;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name www.whfrecord.com; # 域名配置rewrite ^(.*)$ http://$host$1 permanent; # 默认强制使用https对http进行跳转 #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443 ssl; server_name www.whfrecord.com; ssl_certificate /home/key_dir/1_www.whfrecord.com_bundle.crt; # 指定对应的证书 ssl_certificate_key /home/key_dir/2_www.whfrecord.com.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://127.0.0.1:port/; # 将请求都代理到本机port,这里配置的是项目本地的ip:port 访问域名后会跳转到这个地址里} }}

主要有两个地方

listen 80; 端口的监听listen 443 ssl; 443端口的监听

这两个地方配置的地方修改成功后,在访问就会是https请求

 

  • 评论列表:
  •  假欢劣戏
     发布于 2022-07-08 14:03:53  回复该评论
  • ith-http_stub_status_module:支持nginx状态查询--with-http_ssl_module:支持https--with-pcre:为了支持rewrite重写功能,必须制定pcre(3) 安装make make install(4)
  •  舔夺揽月
     发布于 2022-07-08 11:29:50  回复该评论
  • nfigure --prefix=/opt/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre参数说明:--prefix:设置安装路径 --with-http_stub_status
  •  末屿安娴
     发布于 2022-07-08 13:12:45  回复该评论
  • index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443 ssl; server_name www.whfreco
  •  可难书尽
     发布于 2022-07-08 12:57:50  回复该评论
  • te_key /home/key_dir/2_www.whfrecord.com.key; # 指定对应的私钥 ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m

发表评论:

«    2023年7月    »
12
3456789
10111213141516
17181920212223
24252627282930
31
标签列表
文章归档

Powered By

Copyright Your WebSite.Some Rights Reserved.