码迷,mamicode.com
首页 > 其他好文 > 详细

nginx浏览目录

时间:2015-04-16 19:40:36      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

[root@localhost domains]# vi web.jd.com 

      location / 
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        upstream tomcat_web.jd {
                server 127.0.0.1:8013  weight=10 max_fails=2 fail_timeout=30s;
                }
server
                {
                listen                   80;
                server_name              web.jd.com web.jd.local;
                access_log               /export/servers/nginx/logs/web.jd.com/web.jd.com_access.log main;
                error_log                /export/servers/nginx/logs/web.jd.com/web.jd.com_error.log warn;
                chunkin on;
                error_page 411 = @my_error;
                location @my_error {
                chunkin_resume;
                 }
                root /export/App/web.jd.com/;
      location / {
        root /export/App/web.jd.com/; //加上这句!!
        proxy_next_upstream     http_500 http_502 http_503 http_504 error timeout invalid_header;
        proxy_set_header        Host  $host;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        expires                 0;
     proxy_pass              http://tomcat_web.jd; //去掉这句!! autoindex on; } location
/logs/ { autoindex off; deny all; } }

 

这样就能通过 http://web.jd.com/product/try/1.0.0/html/ 访问了

nginx浏览目录

标签:

原文地址:http://www.cnblogs.com/zhishaofei/p/4432794.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!