This is the whole conf: nginx.conf: user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; sendfile on; tcp_nopush on; tcp_nodelay off; keeby NoSync - Nginx Mailing List - English
There you go: 2009/06/16 14:27:46 6580#0: *21 malloc() 18446744073709551612 bytes failed (12: ), client: 89.96.xxx.xxx, server: ~^(.*)\.(.*\..*)$, request: "GET / HTTP/1.1", host: "www.digitalnatives.eu" And here's a strace: accept(7, {sa_family=AF_INET, sin_port=htons(41325), sin_addr=inet_addr("89.96.xxx.xxx")}, [7899595229974495248]) = 8 ioctl(8, FIONBIOby NoSync - Nginx Mailing List - English
As suggested, I tried using servername in place of the if block: server_name ~^(.*)\.(.*\..*)$; set $sub $1; set $domain $2; but I get errors like this: 2009/06/16 13:33:20 6443#0: *4 malloc() 18446744073709551612 bytes failed (12: ), client: 89.96.xxx.xxx, server: ~^(.*)\.(.*\..*)$, request: "GET / HTTP/1.1", host: "www.xxxxxxx.eu" 2009/06/16 13:33:24 6443#0: *15by NoSync - Nginx Mailing List - English
I could be wrong, but with your snippet I'd get domain.com redirected to www.domain.com, but also sub.domain.com redirected to www.sub.domain.com. Very possible I'm missing something here, though. :-)by NoSync - Nginx Mailing List - English
Thanks Igor. I was thinking about this as well, but while I'd like to add the www part only if there's no subdomain at all, I take it this would prepend the "www" part to any host?by NoSync - Nginx Mailing List - English
Hello everyone! I recently switched my main webserver (where I host clients' websites) from apache to nginx and I wrote a custom generic configuration file to handle everything in one place, so domains and subdomains are handled on the fly by creating directories and subdirectories. Here's the relevant snippet: server { listen 80 default; if ($host ~* ^(.*by NoSync - Nginx Mailing List - English