博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
配置nginx反向代理解析不同域名转发到不同端口
阅读量:4293 次
发布时间:2019-05-27

本文共 795 字,大约阅读时间需要 2 分钟。

nginx配置

网站主页的配置:

#我的主页	server {		listen 80;		charset     utf-8;		server_name  www.zksky.top;		root /var/www/html;		index index.html index.htm;        location / {		try_files $uri $uri/ =404;		}	}

博客网站配置

#我的博客网站,nginx反向代理	server {        	listen       80;		    charset     utf-8;        	server_name  blog.zksky.top;        	location / {			proxy_pass    http://www.zksky.top:8081/;        		proxy_set_header Host $host;          		proxy_set_header X-Real-IP $remote_addr;           		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                #nginx跟后端服务器连接超时时间(代理连接超时)        		proxy_connect_timeout      300;                  #后端服务器数据回传时间(代理发送超时)        		proxy_send_timeout         300;                #连接成功后,后端服务器响应时间(代理接收超时)        		proxy_read_timeout         300; 		}    }

 

转载地址:http://gwyws.baihongyu.com/

你可能感兴趣的文章
NSNotificationCenter 和 NSNotificationQueue 使用
查看>>
Web 工程环境变量配置步骤
查看>>
Objective-C 类与实例调用 self 方法的区分
查看>>
思维方法
查看>>
写好博客
查看>>
SystemConfiguration 简介
查看>>
XSD 小结
查看>>
iText 简介
查看>>
Spring Boot 获取 WAS 配置的 JNDI 数据库连接
查看>>
Lambda 表达式详解
查看>>
合并PDF(保留其本身的大小)
查看>>
Spring Boot 参数转换
查看>>
元注解
查看>>
PGP 简介
查看>>
蓝牙简介
查看>>
2020年书单
查看>>
npm 简介
查看>>
Redis 简介一
查看>>
Redis 简介二
查看>>
命令行截取路径
查看>>