Hi,
come some take a look at these rewrite rules if they are ok regarding
performance?
if ($host = 'forum.de' ) {
rewrite ^/(.*)$ http://www.forum.de:81/$1 permanent;
}
if ($host ~* ^(www\.)??forum\.(at|ch|com|eu|info|net|org)) {
rewrite ^(.*)$ http://www.forum.de:81 last;
break;
}
}
Thanks 
Juergen
On Mon, Jul 19, 2010 at 1:59 PM, Juergen G. [email protected]
wrote:
if ($host ~* ^(www\.)??forum\.(at|ch|com|eu|info|net|org)) {
rewrite ^(.*)$ http://www.forum.de:81 last;
break;
}
}
Hi!
Never use if ($host β¦
Different servers with different server_names must be used instead:
server
{
server_name forum.de;
location / { rewrite ^ http://www.forum.de:81/$request_uri?
premanent; }
}
server
{
server_name ~^(www.)??forum.(at|ch|com|eu|info|net|org);
location / { rewrite ^ http://www.forum.de:81/$request_uri?
premanent; }
}
β
Boris Dβ¦
On Mon, Jul 19, 2010 at 02:20:49PM +0400, Boris D. wrote:
server_name forum.de;
location / { rewrite ^ http://www.forum.de:81/$request_uri? premanent; }
}
server
{
server_name ~^(www.)??forum.(at|ch|com|eu|info|net|org);
location / { rewrite ^ http://www.forum.de:81/$request_uri? premanent; }
}
Also, in the second server itβs better to use usual names instead of
regex:
server_name forum.at www.forum.at
forum.ch www.forum.ch
...
;
β
Igor S.
http://sysoev.ru/en/
2010/7/19 Igor S. [email protected]:
Also, in the second server itβs better to use usual names instead of regex:
Γ Γ server_name Γ forum.at www.forum.at
Γ Γ Γ Γ Γ Γ Γ Γ Γ forum.ch www.forum.ch
Γ Γ Γ Γ Γ Γ Γ Γ Γ β¦
Γ Γ Γ Γ Γ Γ Γ Γ Γ ;
it would be nice if the config supports simple (extended)
glob(3)-style pattern matching so it would be something like
server_name {www.,}forum.{at,ch,com,eu,info,net,org};
which should be automatically expanded into
www.forum.at
www.forum.ch
www.forum.com
β¦
forum.net
forum.org
β
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
On 19.07.2010 17:49, Edho P Arief wrote:
β¦
forum.net
forum.org
You can use some preprocessor to generate nginx config from template
(with
globs, variables and other features missing in nginx config)
β
Anton Y.
On Tue, Jul 20, 2010 at 4:39 PM, Anton Y. [email protected]
wrote:
You can use some preprocessor to generate nginx config from template (with
globs, variables and other features missing in nginx config)
whare can I find this βsome preprocessorβ?
β
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
www.forum.com
β¦
forum.net
forum.org
You can use some preprocessor to generate nginx config from template (with
globs, variables and other features missing in nginx config)
server_name ~β(www.)?forum.(at|ch|com|eu|info|net|org)β;
or
server_name ~β(www.|)forum.(at|ch|com|eu|info|net|org)β;
?
β
br, Denis F. Latypoff.
www.forum.com
β¦
forum.net
forum.org
You can use some preprocessor to generate nginx config from template (with
globs, variables and other features missing in nginx config)
- server_name ~β(www.)?forum.(at|ch|com|eu|info|net|org)β;
- server_name ~β(www.)?forum.(at|ch|com|eu|info|net|org)β;
or
- server_name ~β(www.|)forum.(at|ch|com|eu|info|net|org)β;
- server_name ~β(www.|)forum.(at|ch|com|eu|info|net|org)β;
?
br, Denis F. Latypoff.
nginx mailing list
[email protected]
nginx Info Page
β
br, Denis F. Latypoff.