nginx 밴드 변수 파라미터 점프

935 단어 Nginx
원인: 일상적인 운영 업무 에서 전단 의 도약 이 많이 나 타 났 고 일상적인 도약 의 실현 을 정리 했다.
proxy_pass  url   ,     location  rewrite  ,          :

location ~ ^/api/([0-9]+)(\.[0-9]+)*/client/ {
    rewrite /(.*)$ /$1 break;
    proxy_pass http://bbb.example.com;
    proxy_set_header Host $proxy_host;
} 

 location rewrite   URI  ,proxy_pass       URI。    (.*)        $1,   /$1    http://bbb.example.com  。



   :
rewrite ^(.*)/dev/  http://admin.jk.com/test/redirect.html break;
    http://admin.jk.com/dev/src/pages/login.html    http://admin.jk.com/dev/           url

   :
rewrite  ^/(.*)$  http://test.jk.com/dev/src/pages/member/memberMessage/msgTransfer.html?code=$1 permanent;
     http://r.test.jk.com/123   ,      /        123       $1    

   :
rewrite  ^/mdt/cloud/(.*)$  http://qerp.qumaiyao.com/api/$1 permanent;
     http://test.jk.com/mdt/cloud/yyxUser/platformExceptionMsg    yyxUser/platformExceptionMsg     $1    

좋은 웹페이지 즐겨찾기