首页 > 其他 > 详细

nginx同域名代理tomcat不同目录下的文件

时间:2015-12-14 19:18:50      阅读:182      评论:0      收藏:0      [点我收藏+]

使用nginx的rewrite实现代理指定目录


笔记

 server {
        listen       80;
        server_name  a.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            #root   html;
            #index  index.html index.htm;
        rewrite ^/.(.*)$ /sos/$1 last;
}
location ~* ^/sos/.*$ {
proxy_pass http://127.0.0.1:8080;
        }


        #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;
        }


有时间在整理

本文出自 “浩子的▁运维笔录ヽ” 博客,请务必保留此出处http://chenhao6.blog.51cto.com/6228054/1722856

nginx同域名代理tomcat不同目录下的文件

原文:http://chenhao6.blog.51cto.com/6228054/1722856

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!