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 ...
随机推荐
- 大数据之路week03--day05(线程 I)
真的,身体这个东西一定要爱护好,难受的时候电脑都不想去碰,尤其是胃和肾... 这两天耽误了太多时间,今天好转了立刻学习,即刻不能耽误!. 话不多说,说正事: 1.多线程(理解) (1)多线程:一个应用 ...
- vue 标题上下滚屏 无缝轮播
参考网址:https://www.jianshu.com/p/b6813193ca0d <template> <div class="wrap" :style=& ...
- vue slot及用法,$slots访问具名slot
- 下载apache旗下Web服务器软件
apache官方网站:http://www.apache.org/ 1.百度搜索apache找到apache官网 2.进入apache官网打开旗下web服务器软件列表 3.进入apache旗下web服 ...
- Ubuntu Linux使用sudo命令搭建java环境
搬运stackoverflow 注意,以下所有命令需要在root权限下执行 1. 在Ubuntu下打开终端命令或用ssh连接到linux. 2. 更新仓库(只有Ubuntu17.4及以下系统可用): ...
- Python3之使用Crypto
pip3 install pycryptodome 快速方式:pip3 install -i https://pypi.douban.com/simple pycryptodome PyCrypto ...
- mouseup([[data],fn])
mouseup([[data],fn]) 概述 当在元素上放松鼠标按钮时,会发生 mouseup 事件. 与 click 事件不同,mouseup 事件仅需要放松按钮.当鼠标指针位于元素上方时,放松鼠 ...
- web批量下载文件到本地
JavaWeb 文件下载功能 文件下载的实质就是文件拷贝,将文件从服务器端拷贝到浏览器端,所以文件下载需要IO技术将服务器端的文件读取到,然后写到response缓冲区中,然后再下载到个人客户端. 1 ...
- SpingMVC入门
Springmvc简介及配置 1. 什么是springMVC? Spring Web MVC是一种基于Java的实现了MVC设计模式的.请求驱动类型的.轻量级Web框架. 2. SpringMVC处理 ...
- Comet OJ - Contest #13 「佛御石之钵 -不碎的意志-」(困难版) 并查集
题意 给一个$ n \times m$ 的网格,每个格子里有一个数字,非 \(0\) 即 \(1\),行从上往下依次编号为 \(1, 2, \cdots, n\),列从左往右依次编号为 \(1, 2, ...