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 ...
随机推荐
- NLP传统基础(3)---潜在语义分析LSA主题模型---SVD得到降维矩阵
https://www.jianshu.com/p/9fe0a7004560 一.简单介绍 LSA和传统向量空间模型(vector space model)一样使用向量来表示词(terms)和文档(d ...
- Python3+Appium学习笔记07-元素定位工具UI Automator Viewer
这篇主要说下如何使用UI Automator Viewer这个工具来定位元素.这个工具是sdk自带的.在sdk安装目录Tools目录下找到uiautomatorviewer.bat并启动它 如果启 ...
- ggplot2绘制Excel所有图
出处:https://brucezhaor.github.io/blog/2016/06/13/excel2ggplot/#%E5%89%8D%E8%A8%80 目录 前言 1.用到的包 2.数据准备 ...
- Red Hat Enterprise Linux 7.0
简介 Red Hat Enterprise Linux是Red Hat公司的Linux发行版,面向商业市场,包括大型机.红帽公司从Red Hat Enterprise Linux 5开始对企业版LIN ...
- python_公共方法
1.计算长度 value = "wangdianchao" # 计算字符个数(长度) number = len(value) print(number) 2.索引取值 value ...
- 第93题:复原IP地址
一. 问题描述 给定一个只包含数字的字符串,复原它并返回所有可能的 IP 地址格式. 示例: 输入: "25525511135" 输出: ["255.255.11.135 ...
- Python中的基本类型简介
1.变量 变量不仅可以是数字,还可以是任意数据类型 命名规范:变量是用一个变量名表示,变量名必须是大小写英文.数字和下划线_的组合,且不能用数字开头 python中等号“=”是赋值语句,可以把任意数据 ...
- mybatis 批量删除添加
mybatis使用foreach进行批量插入和删除操作 转发与 https://www.cnblogs.com/Amaris-Lin/p/8615977.html 一.批量插入 1. ...
- SIGAI机器学习第十四集 支持向量机1
讲授线性分类器,分类间隔,线性可分的支持向量机原问题与对偶问题,线性不可分的支持向量机原问题与对偶问题,核映射与核函数,多分类问题,libsvm的使用,实际应用 大纲: 支持向量机简介线性分类器分类间 ...
- HR# 5题解
T1 我傻了 前20个数暴力开桶记录,后面的每次暴力统计. #include<bits/stdc++.h> #define R register int using namespace s ...