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 ...
随机推荐
- python 学习笔记_1 pip安装、卸载、更新包相关操作及数据类型学习
'''prepare_1 pip安装.卸载.更新组件type 各数据类型''' py -3 -m pip py -3 -m pip listpy -3 -m pip show nosepy -3 -m ...
- hbase实践之flush and compaction
本文主要涉及flush流程,探讨flush流程过程中引入的问题并阐述2种解决策略,最后简要说明Flush执行策略. 对于Compaction,本文主要探讨Compaction要解决的本质问题以及由Co ...
- Django REST framework+Vue 打造生鲜电商项目(笔记二)
(转自https://www.cnblogs.com/derek1184405959/p/8768059.html)(有修改) 接下来开始引入django resfulframework,体现它的强大 ...
- C语言学习系列(二)面向过程和面向对象
一.基本定义 (一).面向过程(procedure oriented programming POP) 面向过程是分析解决问题的步骤,然后用函数把这些步骤一步一步的实现,然后在使用的时候一一调用则可. ...
- myEclipse设置
字符集设置 点击菜单:window——preferences 输入:Workspace 字体大小设置 输入:colors and fonts 本机字体:14 显示行号 输入:Text Editors ...
- border-style
border-style 语法: border-style:<line-style>{1,4} <line-style> = none | hidden | dotted | ...
- java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
在pom.xml文件中添加如下依赖: <!-- https://mvnrepository.com/artifact/cn.easyproject/orai18n --> <depe ...
- learning armbian steps(5) ----- armbian 构建arm rootfs
基于learning armbian step(4) 的总结,我们来实践一下,接下来的会把整个构建的log都贴出来: vmuser@vmuser-virtual-machine:~/qemu-arm$ ...
- 设计模式--UML类图简介
UML:Unified Modelling Language是一种统一建模语言(英语:Unified Modeling Language,缩写 UML)是非专利的第三代建模和规约语言. “+”表示pu ...
- CSP-S模拟测试69 题解
一如既往的垃圾,又回到了那个场场垫底的自己,明明考场上都想到正解了,但是就是拿不到分,可能是互奶把rp用光了吧以后一定加强训练代码能力. T1: 考场上一直yy矩阵快速幂,虽然自己矩阵快速幂一点都不会 ...