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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
宝玉的分享
宝玉的分享
量子位
V
Visual Studio Blog
罗磊的独立博客
Vercel News
Vercel News
B
Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
GbyAI
GbyAI
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

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

刷新页面返回顶部