乐贴网
  • 首页
  • 程序语言
  • AI时代
  • SEO优化
  • 账号分享
  • 每日神器
  • 开源软件
  • 操作系统
  • 更多
    • 数据库
    • 框架
    • 移动开发
    • 人工智能
    • 区块链

nginx简单配置url跳转不生效

Nginx 5年前 52
+-
  1. 首页
  2. Nginx
  3. 正文

nginx简单配置url跳转不生效

就是测试如果访问baidu,则跳转163,我这个怎么不生效

server {
        listen 80;
        server_name www.baidu.com baidu.com;
        location / {
           rewrite .+ http://www.163.com/ permanent;
        }
    }

`

把 location 部分改成这样试下:

location / {
    return 301 http://www.163.com/;
}
JAVAcc++goswiftjavascriptNginxUI/UE 小程序PythonC#phpaspGitHub项目推荐
思否

相关推荐

centos 6.3安装nginx  搭建文件服务器

centos 6.3安装nginx 搭建文件服务器

Web Server 13年前 12294
Centos6下配置resin + nginx 搭建项目发布环境

Centos6下配置resin + nginx 搭建项目发布环境

Web Server 13年前 11656
nginx配置HTTPS - 使用ssl模块配置同时支持http和https并存

nginx配置HTTPS - 使用ssl模块配置同时支持http和https并存

Web Server 13年前 9908
Ubuntu Server 10.04, resin 3.1.10, nginx 0.7.65 架设负载均衡网站

Ubuntu Server 10.04, resin 3.1.10, nginx 0.7.65 架设负载均衡网站

Web Server 13年前 7311
nginx 502 超时错误解决(java版本)

nginx 502 超时错误解决(java版本)

Web Server 13年前 6989
Nginx 简介(写的还不错)

Nginx 简介(写的还不错)

Web Server 13年前 6567
nginx负载均衡应用

nginx负载均衡应用

Web Server 13年前 6331
nginx 负载实现session共享 :附nginx+ resin配置、nginx-upstream-jvm-route安装配置

nginx 负载实现session共享 :附nginx+ resin配置、nginx-upstream-jvm-route安装配置

Web Server 13年前 5692
Ubuntu Server 10.04+resin 3.1.10+nginx 0.7.65快速搭建项目发布环境

Ubuntu Server 10.04+resin 3.1.10+nginx 0.7.65快速搭建项目发布环境

Web Server 13年前 4880
虚拟机中安装RedHat Linux 5 部署 Glassfish v3【持续更新。。。】

虚拟机中安装RedHat Linux 5 部署 Glassfish v3【持续更新。。。】

Web Server 13年前 4678
IIS6+resin3整合项目发布,支持多站点配置

IIS6+resin3整合项目发布,支持多站点配置

Web Server 13年前 4214
Ubuntu中配置开发环境 jdk1.6 + eclipes3.X + sqldeveloper

Ubuntu中配置开发环境 jdk1.6 + eclipes3.X + sqldeveloper

Web Server 13年前 3744

Copyright © 2012 乐贴网 - All rights reserved