当前位置: 首页 > news >正文

苏州网站设计公司哪家便宜/路由器优化大师

苏州网站设计公司哪家便宜,路由器优化大师,如何下载网站模板文件在哪里,福州网站建设优化Nginx 卸载https 实现https请求转换为http 请求 背景:项目要求第三方应用请求外网服务器的时候使用https进行请求,内网服务接收的时候需要http接收 Nginx安装SSL证书配置nginx.conf配置 Nginx安装此处不做介绍 网上一大推 SSL证书配置 cd /etc/pki/…

Nginx 卸载https 实现https请求转换为http 请求

背景:项目要求第三方应用请求外网服务器的时候使用https进行请求,内网服务接收的时候需要http接收

  • Nginx安装
  • SSL证书配置
  • nginx.conf配置

Nginx安装此处不做介绍 网上一大推

SSL证书配置

  • cd /etc/pki/CA
  • umask 007; 授予权限
  • openssl genrsa -out private/cakey.pem 2048 为CA生成一个私钥
  • openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 365 生成自签名证书
  • cd etc
  • cd nginx 如果没有nginx 创建 nginx mkdir nginx
  • cd ssl 同理 创建 mkdir ssl
  • umask 077 授权
  • openssl genrsa 1024 >nginx.pri 用户生成自己私钥
  • openssl req -new -key nginx.pri -out nginx.csr 生成证书签署请求
  • openssl ca -in nginx.csr -out nginx.crt -days 365 CA为签署请求签名
  • vi /etc/sysctl.conf net.ipv4.ip_forward = 1

以上操作主要是在本机生成自己的证书和密钥

配置 nginx.conf


#user  nobody;
worker_processes  24;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;worker_rlimit_nofile 204800;events {use epoll;multi_accept on;worker_connections  204800;
}http {                               server_tokens off;sendfile on;tcp_nopush on;tcp_nodelay on;access_log off;#error_log /var/log/nginx/error.log crit;keepalive_timeout 60;client_header_timeout 10;client_body_timeout 10;reset_timedout_connection on;send_timeout 60;open_file_cache max=1000000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on;include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;#sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;#keepalive_timeout  65;#gzip  on;gzip  on;gzip_min_length 10240;gzip_proxied expired no-cache no-store private auth;gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;gzip_disable "MSIE [1-6].";#websocket 需要加下这个map $http_upgrade $connection_upgrade {default upgrade;''      close;}upstream http_server_a2 {server 192.168.xxx.xxx:8080 max_fails=1 weight=5 fail_timeout=100s;server 192.168.xxx.xxx:8080 max_fails=1 weight=5 fail_timeout=100s;}server {listen       8080;server_name  http_server_a2;location / {index  index.html index.htm;proxy_pass   http://http_server_a2;proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;client_max_body_size 50m;proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404 non_idempotent;#proxy_next_upstream_tries 1;client_body_buffer_size 256k;proxy_connect_timeout 10;proxy_send_timeout 60;proxy_read_timeout 60;proxy_buffer_size 4k;proxy_buffers 4 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k;}}server {listen       443;server_name  https_server_a2;ssl                  on; # 必要条件ssl_certificate      /etc/nginx/ssl/nginx.crt;  #证书位置ssl_certificate_key  /etc/nginx/ssl/nginx.pri;  #私钥位置ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers  HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers  on;location / {index  index.html index.htm;proxy_pass   http://http_server_a2;proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;client_max_body_size 50m;proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404 non_idempotent;client_body_buffer_size 256k;proxy_connect_timeout 10;proxy_send_timeout 60;proxy_read_timeout 60;proxy_buffer_size 4k;proxy_buffers 4 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k;}}}

配置介绍

8080 里面的配置不做介绍 这个是http的容灾设置
443 里面的配置是https转换为http
ssl on; # 必要条件
ssl_certificate /etc/nginx/ssl/nginx.crt; #证书位置
ssl_certificate_key /etc/nginx/ssl/nginx.pri; #私钥位置
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

加粗为关键词

在这里插入图片描述

以上配置即可实现 通过jemeter 访问nginx nginx转为http 访问服务器 实现SSL卸载

http://www.lbrq.cn/news/1296199.html

相关文章:

  • 阜阳恒亮做网站多少钱/安卓优化大师官网
  • wordpress 建网页/网站优化推广方案
  • 哪里有专门做gif的网站/软文通
  • 注册网站大全/友链交换有什么作用
  • 怎么把网站链接做二维码/创新驱动发展战略
  • 北京网站制作的/国家免费职业培训平台
  • 国外那些视频网站做的不错/seo搜索引擎优化期末考试
  • jsp技术做网站有什么特点/公司推广渠道
  • 域名网站教程/公司网站模版
  • 如何在php网站上插入站长统计/网站权重怎么提高
  • 临沂网站建设公司排名/网络营销策略主要包括
  • 苏州做门户网站的公司/网店运营实训报告
  • seo网站排名优化价格/网站的推广方法有哪些
  • 网站首页的滚动大图怎么做/精准大数据获客系统
  • 微页制作网站模板免费下载/网络营销实践总结报告
  • 广州建设工程信息网站/哔哩哔哩推广网站
  • 网站做代码图像显示不出来/网页广告
  • 如何给网站的关键词做排名/b2b外链代发
  • 学做预算有网站吗/品牌营销推广方案
  • 如何查询网站二级页面流量/seo关键词排名优化教程
  • 网站建设各模块功能简述/网站站内关键词优化
  • 非主营电子商务企业网站有哪些/东营百度推广公司
  • 网站建设合同标的/什么网站可以免费发广告
  • 30岁女人学网站开发可以吗/推荐友情链接
  • 树莓派做博客网站/最近10条重大新闻
  • wordpress备份和还原/seo是什么级别
  • 基于MVC模式的Web网站开发的优点/搜狗seo刷排名软件
  • 网站首页包括哪些内容/济南专业seo推广公司
  • 怎么验证网站备案密码是否正确/百度竞价的优势和劣势
  • 怎样做网站api接口/站长工具seo综合查询columbu cat
  • 【1】YOLOv13 AI大模型-可视化图形用户(GUI)界面系统开发
  • SSE和WebSocket区别到底是什么
  • WireShark抓包分析TCP数据传输过程与内容详解
  • 力扣面试150题--搜索插入位置
  • 【数据类型与变量】
  • 【51】MFC入门到精通——MFC串口助手(一)---初级版(初始化、串口设置、修改参数、打开/关闭、状态显示),附源码