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

nginx简单配置url跳转不生效

Nginx 3年前 51
+-
  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#phpasp
思否

相关推荐

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

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

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

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

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

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

Web Server 11年前 9884
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 12年前 7295
nginx 502 超时错误解决(java版本)

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

Web Server 12年前 6972
Nginx 简介(写的还不错)

Nginx 简介(写的还不错)

Web Server 12年前 6535
nginx负载均衡应用

nginx负载均衡应用

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

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

Web Server 11年前 5678
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 12年前 4844
虚拟机中安装RedHat Linux 5 部署 Glassfish v3【持续更新。。。】

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

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

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

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

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

Web Server 12年前 3710

Copyright © 2012 乐贴网 - All rights reserved