比如: http://127.0.0.1/ 对应的物理路径 c:/a/b/c

比如:http://127.0.0.1/eec 访问的地址对应的物理路径: d:/a/b/c

  1. #user nobody;
  2. worker_processes 1;
  3.  
  4. #error_log logs/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7.  
  8. #pid logs/nginx.pid;
  9.  
  10. events {
  11. worker_connections 1024;
  12. }
  13.  
  14. http {
  15. include mime.types;
  16. default_type application/octet-stream;
  17.  
  18. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  19. # '$status $body_bytes_sent "$http_referer" '
  20. # '"$http_user_agent" "$http_x_forwarded_for"';
  21.  
  22. #access_log logs/access.log main;
  23.  
  24. sendfile on;
  25. #tcp_nopush on;
  26.  
  27. #keepalive_timeout 0;
  28. keepalive_timeout 65;
  29.  
  30. #gzip on;
  31.  
  32. upstream ecc {
  33. server 127.0.0.1:18001 weight=1; #ecc
  34. }
  35.  
  36. upstream myapp1 {
  37. server 127.0.0.1:18001;
  38. }
  39.  
  40. server {
  41. listen 80;
  42. server_name localhost;
  43.  
  44. #charset koi8-r;
  45.  
  46. #access_log logs/host.access.log main;
  47.  
  48. location / {
  49. #root html;
  50. root D:\Work\HiLifeApp\source_org\HiLifeApp\devapp;
  51. index index.html index.htm;
  52. }
  53.  
  54. #error_page 404 /404.html;
  55.  
  56. # redirect server error pages to the static page /50x.html
  57. #
  58. error_page 500 502 503 504 /50x.html;
  59. location = /50x.html {
  60. root html;
  61. }
  62.  
  63. location /eec/ {
  64. #rewrite ^/eec/(.*)$ /$1 last;
  65. #root D:/Work/EEC/Source/EEC_org/devapp/;
  66. #index index.html index.htm;
  67.  
  68. #上面这种代理的形试也是可以的。
  69. proxy_pass http://myapp1;
  70. }
  71. }
  72. server {
  73. listen 18001;
  74. server_name localhost;
  75.  
  76. access_log logs/eec.access.log ;
  77. location / {
  78. rewrite ^/eec/(.*)$ /$1 last;
  79. root D:/Work/EEC/Source/EEC-Mobile-App/devapp/;
  80. index index.html index.htm;
  81. }
  82.  
  83. location ^~ /www {
  84. rewrite ^/eec/(.*)$ /$1 last;
  85. root D:/Work/EEC/Source/EEC-Mobile-App/;
  86. index index.html index.htm;
  87. }
  88. }
  89.  
  90. server {
  91. listen 18000;
  92. server_name localhost;
  93.  
  94. #access_log logs/market.access.log ;
  95. location / {
  96. #root html;
  97. root E:\other\market\devapp;
  98. #如果上面的那个用不了的。可以试试这个
  99. #alias E:\other\market\devapp;
  100. index index.html index.htm;
  101. }
  102.  
  103. location ^~ /www {
  104. root D:/Work/HiLifeApp/source/HiLifeApp/;
  105. #如果上面的那个用不了的。可以试试这个
  106. #alias /home/liaohb/other/http/shopstyle;
  107. index index.html index.htm;
  108. }
  109. }
  110. }

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. Bootstrap 的 Tooltip 和 Popover

    简介 Tooltip 指提示框,Popover 指弹出框. Tooltip 默认 Tooltip 功能是关闭的,使用前要手动开启. $(function () { $('[data-toggle=&q ...

  2. 读取txt文件将文本行组合成特定格式

    有一网友要求从txt文本文件读取一些数据,然后组合为特定格式的数据行.原论题如下,刚才开始的要求描述得不太清楚,后来补充完整了. Insus.NET觉得本论题可有练习文本件读取功力,因此尝试实现一下. ...

  3. 【IMOOC学习笔记】多种多样的App主界面Tab实现方法(四)

    ViewPagerIndicator+ViewPager 要想使用ViewPagerIndicator,要使用到viewPagerlibrary开源库 top.xml <?xml version ...

  4. 通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven'

    配置Spring时出现如题这个错误,下面是xml的内容 <?xml version="1.0" encoding="UTF-8"?> <bea ...

  5. jQuery 插件开发——GridData(表格)

    导读:我个人认为做开发最幸福的事之一就是设计一套属于自己的控件,老早之前就想去做这样的事情,一直碍于事件的冲突和个人的想法,最终没有定论,最近难得抽出一些空隙,去完成这件事情.其实自定义控件并不是难事 ...

  6. Docker-教程(一)CentOS Docker 安装

    Docker支持以下的CentOS版本: CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本 前提条件 目前,CentOS 仅发行版本中的内核支持 Docker. ...

  7. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

    原文链接:https://blog.csdn.net/hq091117/article/details/79065199 https://blog.csdn.net/allen_tsang/artic ...

  8. luogu1447 [NOI2010]能量采集 莫比乌斯反演

    link 冬令营考炸了,我这个菜鸡只好颓废数学题了 NOI2010能量采集 由题意可以写出式子: \(\sum_{i=1}^n\sum_{j=1}^m(2\gcd(i,j)-1)\) \(=2\sum ...

  9. kuangbin专题十六 KMP&&扩展KMP POJ2752 Seek the Name, Seek the Fame

    The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the l ...

  10. kuangbin专题七 HDU3974 Assign the task (dfs时间戳建树)

    There is a company that has N employees(numbered from 1 to N),every employee in the company has a im ...