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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
腾讯CDC
Y
Y Combinator Blog
L
LangChain Blog
B
Blog
U
Unit 42
P
Proofpoint News Feed
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
Vercel News
Vercel News
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗

博客园 - 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)    收藏  举报

刷新页面返回顶部