web站点放在nginx其他目录下
web站点放在nginx其他目录下 、查看主配置文件 [root@bogon mysql]# cat /etc/nginx/nginx.conf
user root root;
worker_processes ;
events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; server {
listen ;
server_name www.test.com;
charset utf-;
location / {
root /var/www/www.test.com;
index index.php index.html index.htm;
} location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/www.test.com$fastcgi_script_name;
include fastcgi_params;
}
}
include /etc/nginx/conf.d/*.conf;
} 2、创建其他目录放入静态文件 注意:静态文件必须是index.html 其他的不行 [root@bogon ~]# mkdir /website/
[root@bogon ~]# cd /website/
[root@bogon website]# echo hello >> index.html
[root@bogon website]# ls
index.html
[root@bogon website]# cat index.html
hello 3、配置子配置文件 [root@bogon ~]# cat /etc/nginx/conf.d/test1.conf
server {
listen 8083;
server_name www.test1.com;
charset utf-8;
location / {
root /website;
index index.php index.html index.htm;
} location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /website$fastcgi_script_name;
include fastcgi_params;
} } 4、重新加载nginx [root@bogon conf.d]# nginx -s reload 5、访问测试 [root@bogon conf.d]# curl http://127.0.0.1:8083
hello
web站点放在nginx其他目录下的更多相关文章
- django中,如何把所有models模型文件放在同一个app目录下?
django的每个app目录下,都有自己的models.py文件. 原则上,每个app涉及的数据库,都会定义在这个文件里. 但是,有的数据库,涉及到多个app应用,不是很方便放在一个单独的app里. ...
- CustomEditor的文件要放在Assets/Editor目录下
using UnityEditor; using UnityEngine; [CustomEditor(typeof(test))] public class testEditor : Editor ...
- nginx其他目录下上传站点
1.查看主配置文件 [root@bogon ~]# cat /etc/nginx/nginx.conf user root root; worker_processes auto; worker_rl ...
- WEB编程中获取src目录下的文件(没有src目录)
这种情况遇见的会比较多,像一个WEB工程,如果在src下面写了一个xml或者一些其它的文件,当工程发布到服务器时,web程序是在tomcat等服务器下运行这个程序的,这个时候,程序目录里面并没有src ...
- 读取普通java web项目下的WEB-INF目录下的配置文件(application.xml,xx.properties等配置文件)
一.在Java web工程WEB-INF下创建weixin.properties属性文件 weixin.properties属性文件里内容如下: 二.创建PropertiesUtils.java测试类 ...
- idea中 mybatis的debug文件需要放在src的目录下 不能加多余的路径
- springboot的启动类不能直接放在src/java目录下,不然会报错
jar包的application.yml 会被项目的覆盖,导致找不到原有的配置
- tomcat 发布的web项目不在webapps目录下
双击服务器(如果服务器再启动,请停止并删除里面的项目,再clean一下), server location 选择use tomcat installation: deploy path 改为webap ...
- 如何配置任意目录下Web应用程序
1,首先创建一个Web项目,tomcat 7, JDK 1.8 2,创建Web项目并部署到tomcat服务器下运行的步骤和方法: 在Eclipse下创建一个JAVA project 在JAVA项目下创 ...
随机推荐
- jsfuck-原理
jsfuck真的fuck,第一眼就是WTF?? Example The following source will do an alert(1): [][(![]+[])[+[]]+([![]]+[] ...
- Python中关于csv的简单操作
Python中关于csv的简单操作 CSV操作简单,直接import csv即可, 主要使用reader和pandas 1 reader的简单使用 csv.reader("1.csv&quo ...
- 转 shell中的多进程【并发】
原文地址https://bbs.51cto.com/thread-1104907-1-1.html 根据我个人的理解, 所谓的多进程 只不过是将多个任务放到后台执行而已,很多人都用到过,所以现在讲的主 ...
- BZOJ1491 [NOI2007]社交网络[最短路计数]
$n$非常的小,结合题目计算式可以想到$O(n^3)$暴枚$s,t,v$,看$v$在不在$s\to t$最短路上($dis_{s,v}+dis_{v,t}=dis_{s,v}$是$v$在两点最短路上的 ...
- 第十一章 前端开发-css
第十一章 前端开发-css 1.1.0 css介绍 css是指层叠样式表(Cascading Style Sheets),样式定义如何显示html元素,样式通常又会存在于样式表中. css优势: 内容 ...
- Can't specify target table for update in FROM clause
UPDATE tbl SET col = ( SELECT ... FROM (SELECT.... FROM) AS x); 额外嵌套了一个 SELECT 语句 例如LeetCode 中的 Dele ...
- Word:表格在页面中垂直居中
本文适用于Word 2007 + Windows 7,熊猫帮帮主@cnblogs 2018/2/22 如何让表格在页面上垂直居中呢.想当然的认为这属于表格的设置,在表格属性和其它表格相关选项中一通猛找 ...
- zabbix服务端接收的数据类型,便于编写脚本向服务端提交数据
1.数据类型1:zabbix_agent执行脚本提交字典 UserParameter=tcp_port_listen,/usr/local/zabbix/share/script/get_game_p ...
- 支持快应用的http网络库-flyio
Fly.js 一个基于Promise的.强大的.支持多种JavaScript运行时的http请求库. 有了它,您可以使用一份http请求代码在浏览器.微信小程序.Weex.Node.React Nat ...
- A. Odds and Ends(思维)
A. Odds and Ends time limit per test 1 second memory limit per test 256 megabytes input standard inp ...