nginx 访问路径配置
比如: http://127.0.0.1/ 对应的物理路径 c:/a/b/c
比如:http://127.0.0.1/eec 访问的地址对应的物理路径: d:/a/b/c
#user nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} 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"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on; upstream ecc {
server 127.0.0.1:18001 weight=1; #ecc
} upstream myapp1 {
server 127.0.0.1:18001;
} server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
#root html;
root D:\Work\HiLifeApp\source_org\HiLifeApp\devapp;
index index.html index.htm;
} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} location /eec/ {
#rewrite ^/eec/(.*)$ /$1 last;
#root D:/Work/EEC/Source/EEC_org/devapp/;
#index index.html index.htm; #上面这种代理的形试也是可以的。
proxy_pass http://myapp1;
}
}
server {
listen 18001;
server_name localhost; access_log logs/eec.access.log ;
location / {
rewrite ^/eec/(.*)$ /$1 last;
root D:/Work/EEC/Source/EEC-Mobile-App/devapp/;
index index.html index.htm;
} location ^~ /www {
rewrite ^/eec/(.*)$ /$1 last;
root D:/Work/EEC/Source/EEC-Mobile-App/;
index index.html index.htm;
}
} server {
listen 18000;
server_name localhost; #access_log logs/market.access.log ;
location / {
#root html;
root E:\other\market\devapp;
#如果上面的那个用不了的。可以试试这个
#alias E:\other\market\devapp;
index index.html index.htm;
} location ^~ /www {
root D:/Work/HiLifeApp/source/HiLifeApp/;
#如果上面的那个用不了的。可以试试这个
#alias /home/liaohb/other/http/shopstyle;
index index.html index.htm;
}
}
}
nginx 访问路径配置的更多相关文章
- Nginx访问限制配置
Nginx访问限制配置 nginx访问限制可以基于两个方面,一个是基于ip的访问控制,另一个是基于用户的信任登陆控制 下面我们将对这两种方法逐个介绍 基于IP的访问控制 介绍: 可以通过配置基于ip的 ...
- Nginx访问权限配置
最近建个人网站,在服务器上新建了一个用户zengfp,并且把网站的目录放到了/home/zengfp/www目录下,配置的nginx: server { listen 80 default_serve ...
- Nginx 访问日志配置
一.Nginx 访问日志介绍 Nginx 软件会把每个用户访问网站的日志信息记录到指定的日志文件里,供网站提供者分析用户的浏览行为等,此功能由 ngx_http_log_module 模块负责. 二. ...
- Jenkins访问路径配置自定义的相对路径
Jenkins安装时没有配置自定义的相对访问路径,例如配置的端口是29957,那访问路径就是http://localhost:29957.以下介绍把访问路径改成http://localhost:299 ...
- Servlet+JSP 对外访问路径配置
servlet类似 servlet配置为: <servlet> <servlet-name>Demo01_OutWrite</servlet-name> ...
- nginx代理路径配置总结
一.发现问题 配置nginx代理的时候,发现location配置的路径和代理的上下文路径的组合不同,服务端接收到的uri的路径不同,导致了controller的RequestMapping匹配出现问题 ...
- Nginx访问路径添加密码保护
创建口令文件 用openssl命令创建口令 openssl passwd -apr1 会产生一个hash口令, 然后和用户名一起, 以[用户名]:[hash口令]的格式写入文本文件即可 例如创建一个名 ...
- Nginx访问限速配置方法详解
开发测试阶段在本地限速模拟公网的环境,方便调试.投入运营会有限制附件下限速度,限制每个用户的访问速度,限制每个IP的链接速度等需求. 配置简单,只需3行,打开"nginx根目录/conf/n ...
- nginx文件路径配置(root|alias)
nginx指定文件路径主要有两种方式:root|alias. 那么他们究竟有什么区别呢? 指令的使用方法和作用域: [root] 语法:root path 默认值:root html 配置段:http ...
随机推荐
- Bugly升级应用集成指南
1.配置 app/build.gradle android { defaultConfig { ndk { //设置支持的SO库架构 abiFilters 'armeabi' //, 'x86', ' ...
- WinForm 生命周期, WinForm 事件执行顺序
1.窗体启动: Control.HandleCreatedControl.BindingContextChangedForm.LoadControl.VisibleChangedForm.Activa ...
- FineUI从iis6迁移到iis7.5上遇到的奇葩事情
前天把一台旧服务器上的windows2003+iis6上的fineui项目迁移到了win7+iis7上面来了,没有编译,直接以源码方式运行. 本来运行的好好的,昨天下午在上面用vs2010打开了一下看 ...
- CefSharp49.0.1 SetZoomLevel
SetZoomLevel(double zoomLevel) -8<= zoomLevel <=9 Each zoom level increases the zoom by 20%. ...
- dubbo事件通知机制 (2)
此文已由作者赵计刚授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 142 * 反射执行xxxService.onthrow方法:至少要有一个入参且第一个入参类型为T ...
- loj #2254. 「SNOI2017」一个简单的询问
#2254. 「SNOI2017」一个简单的询问 题目描述 给你一个长度为 NNN 的序列 aia_iai,1≤i≤N1\leq i\leq N1≤i≤N,和 qqq 组询问,每组询问读入 l1 ...
- P2700 逐个击破
题意:现在有N个城市,其中K个被敌方军团占领了,N个城市间有N-1条公路相连,破坏其中某条公路的代价是已知的, 现在,告诉你K个敌方军团所在的城市,以及所有公路破坏的代价,请你算出花费最少的代价将这K ...
- 洛谷 P1036 选数
嗯.... 这种类型的题在新手村出现还是比较正常的, 但是不知道为什么它的分类竟然是过程函数与递归!!!(难道这不是一个深搜题吗??? 好吧这就是一道深搜题,所以千万别被误导... 先看一下题目: 题 ...
- http 与 TCP 与 socket 定义,区别
http://blog.csdn.net/jenminzhang/article/details/47017741 http协议:处于互联网协议的应用层,角色是规定数据传输的格式,http是建立在so ...
- Eclipse报错:Attribute "xmlns" was already specified for element "web-app".
原因: 在Eclipse中修改了已有的Web工程的工程名,然后出现该错误. Attribute "xmlns" was already specified for element ...