The need for sensible defaults

A case of switching from Nginx to CaddyWhen installing a new VPS for a new project, I had to dive in my previous nginx boilerplate configuration files to create a new one, slightly different, to accomodate for my various needs on the project. While doing so, I remembered how long…

HTTPS and no www with Nginx

I have tried to find the most efficient way to redirect all trafic for a specific domain to its https counterpart, and also to redirect to the domain without the www subdomain. I'm using Nginx in production and after combining various different solutions I found, I settled on this simple…

Tidy up /var/log/nginx easily

When logs take too much space and prevent you from listing and debugging easily in /var/log/nginx, it's time to act. logrotate.d i generally installed by defaults on distros like Debian and Ubuntu and can help us in this task. Nginx being a good guy, it already has…

HHVM and multiple sites

When using HHVM when you come from the PHP world (I'm talking about the binaries, not the language), you can easily get lost when trying to serve multiple sites on one server. That's why using a single instance of HHVM on one server to serve many sites can be a…

Redirect www.* with Nginx

To redirect a www domain to the « root » domain with Nginx, one always prefers not to make any use of the if syntax (because it's evil), and rather use two different server directives for each rule : server { server_name www.domain.com; return 301 $scheme://domain.com$request_uri; } server…