nginx 302 301 设置 url 转跳 nginx 资源重定向 nginx tcp 转发

#---ssl 301 转跳 ---#   

 if ($server_port = 80){

          rewrite ^(/2.php)$ http://www.eisc.cn$1 permanent;

       }

#--- 目录301 转跳 ---#

设置 301 转跳, 

location /ccb/ {

    return 301 http://work.eisc.cn;

    proxy_pass http://eisc.cn/cs;

    index  index.html index.htm;

}



# 设置 302 重定向 

location /ccb/ {

    rewrite /ccb/activity(.*)$ https://www.baidu.com break;

    proxy_pass http://192.168.118.14/;

    index  index.html index.htm;

}


#----------------------------   nginx 转发 反向代理 -----------------------------#

 # nginx 子站点tcp转发


server{

listen 80 ;

listen 443;


server_name kbash.cn www.kbash.cn;


location / {

     proxy_pass http://82.157.148.144:80;

     index index.php index.html;

  }

}



#---------------------------------------------------------------------#

上一篇:小文——在C# WinForm中如何使当前应用程序只允许启动一个实例


下一篇:不会写漂亮代码不是优秀的程序员,没有钢铁侠之躯不是合格的程序员