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

简介: nginx 转发

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

 }

}



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

目录
相关文章
|
网络协议 前端开发 应用服务中间件
nginxconf.sh 自动生成 nginx tcp 转发配置文件 conf
该脚本由 eisc.cn 开发,用于自动生成 Nginx 代理配置。它根据预设的域名、IP 和端口信息,为多个项目(如 www、work、sou 等)创建对应的 Nginx 配置文件,设置前端转发、端口对端口及后端转发规则,并生成日志和 301 跳转配置。支持自动创建 CGI 解析目录,确保各项目能够正确访问。运行时需具备 root 权限或使用 sudo。
602 9
|
前端开发 Java 应用服务中间件
Tomcat和Nginx的资源路径映射
Tomcat和Nginx的资源路径映射
688 1
|
应用服务中间件 nginx
Nginx:怎么携带参数重定向
通过合理配置Nginx的 `rewrite`指令和 `return`指令,可以实现携带参数的重定向。这不仅可以确保用户请求被正确重定向,还可以保留原始查询参数,满足更多复杂的重定向需求。
803 2
|
应用服务中间件 nginx
Nginx:怎么携带参数重定向
通过合理配置Nginx的 `rewrite`指令和 `return`指令,可以实现携带参数的重定向。这不仅可以确保用户请求被正确重定向,还可以保留原始查询参数,满足更多复杂的重定向需求。
1201 1
|
安全 Ubuntu 搜索推荐
如何使用 Nginx 创建临时和永久重定向
如何使用 Nginx 创建临时和永久重定向
628 2
|
网络协议 应用服务中间件 nginx
nginx 302 301 设置 url 转跳 nginx 资源重定向 nginx tcp 和 http 转发
nginx 代理后端网站,和 网站资源目录重定向到其他连接地址
773 3
|
网络协议
【Azure 应用服务】探索在Azure上设置禁止任何人访问App Service的默认域名(Default URL)
【Azure 应用服务】探索在Azure上设置禁止任何人访问App Service的默认域名(Default URL)
407 0
【Azure API 管理】Azure API Management在设置 Policy时,如何对URL进行解码呢? 使用 HttpUtility.UrlDecode 出错
【Azure API 管理】Azure API Management在设置 Policy时,如何对URL进行解码呢? 使用 HttpUtility.UrlDecode 出错
254 0
|
Ubuntu 应用服务中间件 网络安全
如何使用 Apache 和 Nginx 创建临时和永久重定向
如何使用 Apache 和 Nginx 创建临时和永久重定向
443 0
|
负载均衡 网络协议 应用服务中间件
nginx tcp 转发
nginx tcp 转发安装 负载均衡nginx 获取客户端真实 ip
1497 0

热门文章

最新文章