nginx 配置 rewrite 随笔

1.nginx .conf 配置
引用
server {
        limit_conn   myzone  10;
        listen       80;
        server_name  new.iteye.com;//要跳转的URl
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

        proxy_pass http://web;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        error_page  404              /404.html;

        location = /404.html {
            root   /usr/share/nginx/html;
        }

                error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

rewrite ^/$ http://new.iteye.com permanent;

  }



2.tomcat 配置
引用
<Host  appBase="" name="new.iteye.com">
        <Context path="" docBase="/var/www/webapps/newJavaEye" reloadable="true">
        </Context>
      </Host>

猜你喜欢

转载自jbeduhai.iteye.com/blog/841418