惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
月光博客
月光博客
D
DataBreaches.Net
L
LangChain Blog
美团技术团队
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
I
InfoQ
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
腾讯CDC
Martin Fowler
Martin Fowler

博客园 - noneisnull

USB KVM 基于docker/虚拟机的esp32远程工作流 - noneisnull - 博客园 centos 下nginx +php 环境搭建 Could not update ICEauthority file /home/username/.ICEauthority nginx 路径问题 MTK 定时器 休眠时的动作 disruptor google搜索引擎优化初学者指南-学习笔记 Can't load IA 32-bit .dll on a AMD 64-bit platform Google Protocol Buffer 的使用和原理 Create a W3C validated anchor link with target=“_blank” allegro 自动保存 Troubleshooting MySQL Memory Usage nginx http proxy 正向代理 配置电信网通双线双IP的解决办法 优酷网架构学习笔记 浅谈facebook的服务器架构 百度贴吧10亿量级LAMP架构分享 The Linux IO Stack Diagram
nginx 不带www到www域名的重定向
noneisnull · 2013-01-09 · via 博客园 - noneisnull

这里,如果是单次重定向用 redirect, 如果永久跳转用 permanent,这里用 permanent

 {

               listen       80;

               server_name  xxx.com www.xxx.com;

               index index.html index.php;

               root  /data/www/wwwroot;

               if ($http_host !~ "^www.xxx.com$") {

                       rewrite  ^(.*)    http://www.xxx.com$1 permanent;

                 }

               ........................

       }

posted @ 2013-01-09 23:08  noneisnull  阅读(12891)  评论(1)    收藏  举报

刷新页面返回顶部