# -*- mode: nginx; mode: flyspell-prog; mode: autopair; ispell-local-dictionary: "american" -*- ### Nginx configuration for Chive. server { ## This is to avoid the spurious if for sub-domain name ## rewriting. See http://wiki.nginx.org/Pitfalls#Server_Name. listen 80; # IPv4 ## Replace the IPv6 address by your own address. The address below ## was stolen from the wikipedia page on IPv6. listen [fe80::202:b3ff:fe1e:8329]:80 ipv6only=on; server_name www.chive.example.com; return 301 $scheme://chive.example.com$request_uri; } # server domain rewrite. server { listen 80; # IPv4 ## Replace the IPv6 address by your own address. The address below ## was stolen from the wikipedia page on IPv6. listen [fe80::202:b3ff:fe1e:8329]:80 ipv6only=on; limit_conn arbeit 32; server_name chive.example.com; ## Parameterization using hostname of access and log filenames. access_log /var/log/nginx/chive.example.com_access.log; error_log /var/log/nginx/chive.example.com_error.log; root /var/www/sites/chive.example.com; index index.php index.html; ## Support for favicon. Return a 204 (No Content) if the favicon ## doesn't exist. location = /favicon.ico { try_files /favicon.ico =204; } ## The main location is accessed using Basic Auth. location / { ## Access is restricted. auth_basic "Restricted Access"; # auth realm auth_basic_user_file .htpasswd-users; # htpasswd file ## Use PATH_INFO for translating the requests to the ## FastCGI. This config follows Igor's suggestion here: ## http://forum.nginx.org/read.php?2,124378,124582. ## This is preferable to using: ## fastcgi_split_path_info ^(.+\.php)(.*)$ ## It saves one regex in the location. Hence it's faster. location ~ ^(?