nginx多ip多端口多域名方式
2024-10-10 21:37:12
一:Nginx虚拟主机
- 基于多IP的方式
- 基于多端口的方式
- 基于多域名的方式
- 基于多端口的方式
1.基于ip的方式
[root@web01 conf.d]# cat game2.conf
server {
listen 80;
server_name 192.168.15.7;
location / {
root /opt/Super_Marie;
index index.html;
}
}
server {
listen 80;
server_name 172.16.1.7;
location / {
root /opt/tank;
index index.html;
}
}
2、基于多端口的方式
[root@web01 conf.d]# cat game3.conf
server {
listen 80;
server_name 192.168.15.7;
location / {
root /opt/Super_Marie;
index index.html;
}
}
server {
listen 81;
server_name 192.168.15.7;
location / {
root /opt/tank;
index index.html;
}
}
3、基于多域名的方式
[root@web01 conf.d]# cat game4.conf
server {
listen 80;
server_name www.game.com;
location / {
root /opt/Super_Marie;
index index.html;
}
}
server {
listen 80;
server_name www.game1.com;
location / {
root /opt/tank;
index index.html;
}
}
最新文章
- 微信开发包注意jar版本:
- js简单弹出层、遮罩层
- (document).height()与$(window).height()
- tableView主从表在storyboard连线是 Selcetion Segue和Accessory Action的区别
- adb_常用命令
- mysql在一台服务器搭建主从1
- 【转】在rman增量备份中,有差异增量和累积增量的概念
- 把zlog封装成模块,隐藏zlog
- POJ 1426	Find The Multiple BFS
- javascript 三种弹出对话框
- OAuth 2.0(网转)
- 20160224.CCPP体系详解(0034天)
- VBS计时器2
- 利用Navicate把SQLServer转MYSQL的方法(连数据)
- Jmeter - 测试 http 接口
- Loadrunner乱码的解决办法
- ubuntu下安装android sdk运行模拟器出现错误:
- Android中如何实现EditText的自动换行
- 3.11 - 3.12 A day with Google
- mysql表大小写问题
热门文章
- 【LeetCode】1433. 检查一个字符串是否可以打破另一个字符串 Max Difference You Can Get From Changing an Integer
- 【LeetCode】295. Find Median from Data Stream 解题报告(C++)
- 【LeetCode】303. Range Sum Query - Immutable 解题报告(Python)
- 【LeetCode】394. Decode String 解题报告(Python)
- 【LeetCode】319. Bulb Switcher 解题报告(Python)
- C. Hongcow Builds A Nation
- MacOS使用Docker创建MySQL主主数据库
- Windows 11实现直播,VLC超简单实现捕获、串流、播放
- netty系列之:从零到壹,搭建一个SOCKS代理服务器
- Python Revisited Day10 (进程与线程)