【发布时间】:2012-07-20 00:47:52
【问题描述】:
我有一个使用 unicorn Web 服务器堆栈托管在 engineyard 云上的 rails 应用程序。我正在尝试从网站网址中删除 www,但仍然没有运气。我曾经在 .htaccess 中为我的 apache 应用程序提供 RewriteRule,但我不确定 unicorn/nginx。
【问题讨论】:
标签: ruby-on-rails nginx unicorn engineyard
我有一个使用 unicorn Web 服务器堆栈托管在 engineyard 云上的 rails 应用程序。我正在尝试从网站网址中删除 www,但仍然没有运气。我曾经在 .htaccess 中为我的 apache 应用程序提供 RewriteRule,但我不确定 unicorn/nginx。
【问题讨论】:
标签: ruby-on-rails nginx unicorn engineyard
这会将http://www.abc.de 的所有请求重定向到http://abc.de:
server {
server_name www.abc.de;
rewrite ^/(.*) http://abc.de/$1 permanent;
}
server {
server_name abc.de;
# rest of the config goes here
}
你通常把它放在你的虚拟主机配置中/etc/nginx/sites-available/site_name; EngineYard 上的等价物似乎是 /etc/nginx/servers/app_name/custom.conf,但不要引用我的话。
【讨论】: