比如: 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 访问路径配置的更多相关文章

  1. Nginx访问限制配置

    Nginx访问限制配置 nginx访问限制可以基于两个方面,一个是基于ip的访问控制,另一个是基于用户的信任登陆控制 下面我们将对这两种方法逐个介绍 基于IP的访问控制 介绍: 可以通过配置基于ip的 ...

  2. Nginx访问权限配置

    最近建个人网站,在服务器上新建了一个用户zengfp,并且把网站的目录放到了/home/zengfp/www目录下,配置的nginx: server { listen 80 default_serve ...

  3. Nginx 访问日志配置

    一.Nginx 访问日志介绍 Nginx 软件会把每个用户访问网站的日志信息记录到指定的日志文件里,供网站提供者分析用户的浏览行为等,此功能由 ngx_http_log_module 模块负责. 二. ...

  4. Jenkins访问路径配置自定义的相对路径

    Jenkins安装时没有配置自定义的相对访问路径,例如配置的端口是29957,那访问路径就是http://localhost:29957.以下介绍把访问路径改成http://localhost:299 ...

  5. Servlet+JSP 对外访问路径配置

    servlet类似 servlet配置为: <servlet>    <servlet-name>Demo01_OutWrite</servlet-name>    ...

  6. nginx代理路径配置总结

    一.发现问题 配置nginx代理的时候,发现location配置的路径和代理的上下文路径的组合不同,服务端接收到的uri的路径不同,导致了controller的RequestMapping匹配出现问题 ...

  7. Nginx访问路径添加密码保护

    创建口令文件 用openssl命令创建口令 openssl passwd -apr1 会产生一个hash口令, 然后和用户名一起, 以[用户名]:[hash口令]的格式写入文本文件即可 例如创建一个名 ...

  8. Nginx访问限速配置方法详解

    开发测试阶段在本地限速模拟公网的环境,方便调试.投入运营会有限制附件下限速度,限制每个用户的访问速度,限制每个IP的链接速度等需求. 配置简单,只需3行,打开"nginx根目录/conf/n ...

  9. nginx文件路径配置(root|alias)

    nginx指定文件路径主要有两种方式:root|alias. 那么他们究竟有什么区别呢? 指令的使用方法和作用域: [root] 语法:root path 默认值:root html 配置段:http ...

随机推荐

  1. WebGoat系列实验AJAX Security

    WebGoat系列实验AJAX Security DOM Injiction 实验对象是一个接受激活密钥后允许你访问的系统,实验目标是尝试将激活按钮变得可以点击. 直接修改页面代码激活按钮,Chrom ...

  2. 在WinForm中使用Web Services 来实现 软件 自动升级( Auto Update ) (C#)

    winform程序相对web程序而言,功能更强大,编程更方便,但软件更新却相当麻烦,要到客户端一台一台地升级,面对这个实际问题,在最近的一个小项目中,本人设计了一个通过软件实现自动升级技术方案,弥补了 ...

  3. 正经学C#_布尔运算[布尔值与其布尔运算符]:《c#入门经典》

    前面几个章节简述了 C#中得常用得算术运算符.这一章节说布尔值与其布尔运算符. 布尔值在c#中表示方式是 bool类型,这个类型可以储存两个值,true或者false,或者真或者假,可以说0或者1. ...

  4. linux影响上传文件大小的因素

    主要是从三个方面 ①.php代码方面(这个无需说明) ②.php.ini配置 max_execution_time = 600 ;每个PHP页面运行的最大时间值(秒),默认30秒max_input_t ...

  5. (原创)Codeforces Round #550 (Div. 3) D. Equalize Them All

    D. Equalize Them All time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  6. Java框架之搭建环境maven报错

    *maven Dependencies 中的地址通过POM 才会增加 正确是 1. m2所在位置 遇到的问题: java.lang.ClassNotFoundException: org.spring ...

  7. Hyperledger Fabric java chaincode 编译部署(1.4V)

    前提条件: 构建好了一个拥有四个peer 一个Order 的1.4版本的Fabric网络. 证书通过Cryptogen生成,没有使用CA服务. 开启TLS. 网络中的peer都加入了一个 名为mych ...

  8. javascript判断访问终端,手机端自动跳转

    在网页的顶部加入javascript判断代码: function checkserAgent(){ var userAgentInfo=navigator.userAgent; var userAge ...

  9. kuangbin专题十六 KMP&&扩展KMP HDU2328 Corporate Identity

    Beside other services, ACM helps companies to clearly state their “corporate identity”, which includ ...

  10. 利用zookeeper生成唯一id

    package com.cxy.com.cxy.curator; import java.util.concurrent.ExecutorService; import java.util.concu ...