首页天道酬勤nginx转发配置详解,nginx配置文件参数详解

nginx转发配置详解,nginx配置文件参数详解

张世龙 05-12 17:12 38次浏览

nginx传输与https相关的配置

1 .安装nginx和所需模块#安装的编译为yum install-ygccgcc-cpcrepcre-develzlibzlib-devel OpenSSL-devel wget https://nginx org nginx-1.18.0.tar.gztarzxvfnginx-1.18.0.tar.gzcd nginx-1.18.0 # https传输所需的module./要添加配置首选项的nginx---with-stream---with-stream _ SSL _ pre read _ module---with-stream

CP/usr/local/nginx/conf/nginx.conf/usr/local/nginx/conf/nginx.conf-bak

修改config层、7层可能需要目标站点的证书) )。

VI/usr/local/nginx/conf/nginx.conf

用户根; worker_processes auto; error_log logs/error.log; pid logs/nginx.pid; worker_rlimit_core 2G; worker_rlimit_nofile 65535; 事件{ worker _ connections 81920; } stream { log _ format main ' $ remote _ addr-[ $ time _ local ] $ connection ' ' $ status $ proxy _ protocol _ addr $ resolver 114.114.114.114; resolver_timeout 60s; variables_hash_bucket_size 512; 服务器{ listen 443; ssl_preread on; proxy _ pass $ SSL _ pre read _ server _ name :443; }验证配置:

/usr/local/nginx/sbin/nginx -t

启动!

/usr/local/nginx/sbin/nginx

客户端配置

vim /etc/hosts

#添加本地映射192.168.10.100api.open.uc.cn 3.测试curl -i https://api.open.uc.cn

参考:

33559 www.dazhu anlan.com/2020/01/16/5 E1 feb FD 751 BC /

3359 www.cn blogs.com/mango vic/p/12239044.html

3359 www.cn blogs.com/mango vic/p/8359864.html

java重定向和转发的区别,tomcat 代理转发 路由器设置端口转发,nginx反向代理多个端口