nginx反向代理本地 单台wed -使用域名代理
环境: 本地外网ip:123.58.251.166 、配置index.html网页 [root@host---- conf.d]# cat /web/sing/index.html
<h1>www.test1.com</h1> 、配置conf.d目录下配置文件 [root@host---- conf.d]# pwd
/etc/nginx/conf.d
[root@host---- conf.d]# ls
test1.conf test2.conf test3.conf
[root@host---- conf.d]# cat test1.conf
server {
listen ;
server_name 127.0.0.1:;
location / {
root /web/sing/;
index index.html index.htm;
}
} [root@host---- conf.d]# cat test3.conf
upstream abc.com {
server 127.0.0.1: fail_timeout=20s;
#server 127.0.0.1: fail_timeout=20s; #ip_hash; 打开后就会访问到一台上 } server { listen ;
server_name oa.test.com;
location / {
#反向代理的地址
proxy_pass http://abc.com;
}
} 、配置hosts [root@host---- conf.d]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
123.58.251.166 oa.test.com [root@host---- conf.d]# nginx -s reload 、开始访问 注意:要从百度访问必须注册备案域名 [root@host---- ~]# curl http://oa.test.com
<h1>www.test1.com</h1>
nginx反向代理本地 单台wed -使用域名代理的更多相关文章
- nginx反向代理本地 单台wed -使用ip+端口代理
环境: 本地外网ip:123.58.251.166 .配置index.html网页 [root@host---- conf.d]# cat /web/sing/index.html <h1> ...
- 反向代理远端 单台tomcat 使用域名代理
.环境 nginx 10.1.1.161 公网:123.58.251.166 tomcat 10.1.1.103 .远端tomcat 配置 [root@host---- ~]# netstat -tn ...
- Charles学习(三)之使用Map local代理本地静态资源以及配置网页代理在Mac模拟器调试iOS客户端
前言 问题一:我们在App内嵌H5开发的过程中,肯定会遇到一个问题就是我不想在chrome的控制台中调试,我想要在手机上调试,那么如何解决这个问题呢? 问题二:我们期待调试时达到的效果就是和Charl ...
- Charles学习(二)之使用Map local代理本地静态资源以及配置网页代理在Mac浏览器上调试移动端
前言 我们在开发的过程肯定是一边写代码,一边查看自己的代码写的是否存在问题,那么问题来了,有两种情况 情况一:我们可以本地起服务,那么我们就可以在本地检查自己的代码,查看运行结果 情况二:本地无法起服 ...
- nginx反向代理本地 两台web负载均衡 使用域名代理
环境: 本地外网ip:123.58.251.166 .配置index.html网页 [root@host---- conf.d]# cat /web/sing/index.html <h1> ...
- nginx反向代理本地 两台web负载均衡 使用ip+端口代理
环境: 本地外网ip:123.58.251.166 .配置index.html网页 [root@host---- conf.d]# cat /web/sing/index.html <h1> ...
- 反向代理远端 单台tomcat 使用ip+端口
.环境 nginx 10.1.1.161 公网:123.58.251.166 tomcat 10.1.1.103 .tomcat 配置 [root@host---- ~]# netstat -tnlp ...
- Linux系统之LNMP及nginx反向代理实现
1.编译安装LNMP,并安装wordpress 首先准备环境,编译安装LNMP可以是多台主机,也可以是单台主机,把nginx,mysql,php都集中安装在一个主机上:我这里以一台主机为例吧!! 一. ...
- 让网站全面支持v4/v6 HTTP、HTTPS、HTTP/2最简单方法是增加Nginx反向代理服务器
bg6cq/nginx-install: nginx install script https://github.com/bg6cq/nginx-install [原创]step-by-step in ...
随机推荐
- NginX——配置负载均衡
A. 在http模块加上upstream配置 upstream www.myweb.com { server 127.0.0.1:9100 weight=3; server ...
- Disable trigger to avoid the ID is auto-updated
CREATE TABLE COBRA.COBRA_PRODUCT_INFO_BAK AS SELECT * FROM COBRA.COBRA_PRODUCT_INFO; TRUNCATE TABLE ...
- Cairo
Cairo 英[ˈkaɪrəʊ] 美[ˈkaɪroʊ] n. 开罗(埃及首都); [例句]From Cairo came expressions of regret at the attac
- C# 截图不失真
Bitmap bmp = new Bitmap(@"E:\2222.jpg"); Bitmap bmp2 = bmp.Clone(new Rectangle(10 + 80, 15 ...
- Java中的Listener 监听器
Listener的定义与作用 监听器Listener就是在application,session,request三个对象创建.销毁或者往其中添加修改删除属性时自动执行代码的功能组件. Listener ...
- 本月周六周日LIST集合
最近项目中有用到本月所有的周六,周日,特此分享一下! 算法思路:写一个循环,条件为本月开始日期.本月截至日期,通过循环获取第一个周六,加一天就是周日,每增加六天就是下一个周六,依次类推,循环到月末 代 ...
- 2019牛客多校第四场J free——分层图&&最短路
题意 一张无向图,每条边有权值,可以选择不超过 $k$ 条路使其权值变成0,求 $S$ 到 $T$ 的最短路.(同洛谷 P4568) 分析 首先,分层图最短路可以有效解决这种带有 「阶段性」的最短路, ...
- js校验密码必须包含字母大小写、数字
校验密码必须包含字母大小写.数字 function checkPasswordNew(s){ var str=trim(s); //var reg = /^(?![A-Z]+$)(?![a-z]+$) ...
- html2canvas原理
html2canvas有2种模式,一种是利用foreignObject,一种是纯canvas绘制 1.foreignObject到canvas 步骤: 1.把要截图的dom克隆一份,过程中把getCo ...
- POI的XWPFTableCell的方法
1. XWPFParagraph addParagraph() 在这个表格单元格中添加一个段落 2. void addParagraph(XWPFParagraph p) 给这个表格加一段 3. ja ...