Www/no-www rewrite rules for nginx

There are many ways to rewrite www urls to their non-www versions in nginx. Here one that’s Igor-approved and works well on my setup : WWW to Non-WWW: [code]#301 redirect www to non-www server { listen [::]:80; server_name www.domain.com; rewrite ^ http://domain.com$request_uri? permanent; } server { listen [::]:80; server_name domain.com; ………………………………….. ………………………………….. }[/code] Non-WWW to […]

Nginx: Resolving “No input file specified” error

If you are using nginx with php-cgi and have followed the standard procedure to set it up, you might often get the “No input file specified.” error. What happens here is that, when nginx receives the request to serve a non-existent php file, it passes the request to php-cgi. Php-cgi, while trying to processs the […]