nginx多域名设置和多子目录实现共用一端口
nginx多域名设置,多子目录,共用一端口
前段时间自己买了一个80G的服务器,所以想把原来的网站都整合到这台服务器上面,现在在服务器上绑定了五个域名。
下面是对nginx配置文件的设置。
五个域名公用一个端口,80端口,在内部设置子目录。
server {
listen 80;
server_name www.china7s.com;
root /home/ftp/china7s;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
}
server {
listen 80;
server_name www.wtogame.com;
root /home/ftp/LuNamp;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
}
server {
listen 80;
server_name www.hangzhou.la;
root /home/ftp/hangzhou;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
}
server {
listen 80;
server_name www.nginx.name;
root /home/ftp/nginx;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
}
server {
listen 80;
server_name www.axiaoshuo.com axiaoshuo.com;
root /home/ftp/axiaoshuo;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
}
server {
listen 80;
server_name www.19594.com;
root /home/ftp/19594;
location / {
index index.html index.htm index.shtml index.php default.php;
}
#access_log /dev/null lu_access_log_2;
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include enable_php.conf;
}
转载于:https://blog.51cto.com/424243/957996
nginx多域名设置和多子目录实现共用一端口相关推荐
- nginx同域名代理tomcat不同目录下的文件
使用nginx的rewrite实现代理指定目录 笔记 server {listen 80;server_name a.com;#charset koi8-r;#access_log logs/host ...
- Nginx配置模块详解及多站点共用80端口案例
nginx配置 nginx配置文件主要分为四个部分: main(全局设置) http ( ) upstream(负载均衡服务器设置) server(主机设置) location(URL匹配特点位置的设 ...
- nginx配置域名后的二级目录访问不同项目的配置
场景描述: 通过二级目录(虚拟目录,应用程序)的方式访问同一ip+端口的不同应用,例如location是用户使用页面,location/admin/是管理页面,location部署在192.168.1 ...
- 蚂蚁分类信息系统Nginx伪静态规则支持二级域名设置方法
蚂蚁分类信息系统Nginx伪静态规则支持二级域名设置方法 nginx环境中蚂蚁分类信息系统支持二级域名访问实现方法 1.后台生成所有城市目录 2.nginx伪静态增加配置 if ( $host ~* ...
- Nginx多站点设置
2019独角兽企业重金招聘Python工程师标准>>> 方法一:多个.conf方法(优点是灵活,缺点就是站点比较多配置起来麻烦) 这里以配置2个站点(2个域名)为例,n 个站点可以相 ...
- Nginx多域名多Server反向代理配置
Nginx强大的正则表达式支持,可以使server_name的配置变得很灵活,如果你要做多用户博客,那么每个用户拥有自己的二级域名也就很容易实现了. 下面我就来说说server_name的使用吧: s ...
- (转)IIS tomcat共用80端口解决一个IP多个域名:使用Nginx反向代理方式使两者兼容...
from :http://www.cnblogs.com/wuyou/p/3455619.html 环境: windows server 2003,IIS6服务器,Tomcat7服务器 域名有几个: ...
- Nginx根据路径设置静态资源
Nginx根据路径设置静态资源 示例nginx.conf user root; worker_processes auto; error_log /var/log/nginx/error.log; p ...
- Nginx二级域名及多Server反向代理配置
Nginx强大的正则表达式支持,可以使server_name的配置变得很灵活,如果你要做多用户博客,那么每个用户拥有自己的二级域名也就很容易实现了. 注:nginx反向代理同一ip多个域名,给head ...
最新文章
- 04_SpringCloud 整合Ribbon细粒度配置自定义
- Spring 依赖注入(一、注入方式)
- Maven学习总结(48)——利用wagon-maven-plugin插件自动化部署Jar包/war包到Linux远程服务器
- Starling滤镜合集2(新增7种滤镜)
- Julia :where
- CAD批量提取数值lisp插件_CAD批量获取文本坐标及内容
- 三星emcp型号详解_三星emcp型号详解_eMCP终将成为过去式?解析:三星、美光所推出的uMCP为何物?......
- 软件测试工程师的日常工作流程
- APISpace 汉字转拼音API 方便好用
- python彩色蟒蛇绘制代码_Python中用绘图库绘制一条蟒蛇
- 【专栏推荐】硅谷产品实战36讲
- 超图导入ArcGIS数据文件
- Flutter无限循环滑动的PageView
- 在Windows10环境下安装RabbitMAQ、Erlang的坑
- Xtensa处理器架构基础-架构简介与常见寄存器
- strcpy 运用及其实现
- 拉普拉斯分布和拉普拉斯变换有什么区别
- 自学python问题记录1:解决anaconda新建的虚拟环境无法打开jupyternotebook的问题
- 前端三件套——我看HTML及CSS
- 用CSS实现圆角图片
热门文章
- docker提交容器成一个新的镜像commit和push,以及docker常用命令
- gradle的配置文件build.gradle、gradle.properties、settings.gradle示例
- 浅谈如何管理测试团队
- graphics | 基础绘图系统(五)——plot函数功能再探和低级绘图函数
- php网页事件处理方法,PHP实现事件机制的方法
- LeetCode 496. 下一个更大元素 I
- android 系统联系人,Android读取系统联系人
- php 生成器 封装,php生成器
- vscode 插件导出_VScode插件推荐
- 各层电子数排布规则_核外电子的排布规律