server { listen 80; listen 443 default_server ssl; ssl_certificate /var/sites/ianonavy.com/ssl/unified.crt; ssl_certificate_key /var/sites/ianonavy.com/ssl/ssl-decrypted.key; server_name *.ianonavy.com ianonavy.com www.ianonavy.com; access_log /var/log/nginx/ianonavy.access.log; error_log /var/log/nginx/ianonavy.error.log; if ($host != 'ianonavy.com') { rewrite ^/(.*)$ http://ianonavy.com/$1 permanent; } root /var/sites/ianonavy.com/www; location = /robots.txt { alias /var/www/robots/all/robots.txt; } location /static/ { # STATIC_URL alias /var/sites/ianonavy.com/www/src/static/; # STATIC_ROOT expires off; } location = /google9677fb7678857b96.html { rewrite ^/(.*) $1; return 200 "google-site-verification: google9677fb7678857b96.html"; } location / { try_files $uri @ianonavy; } location @ianonavy { include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_NAME ""; fastcgi_pass unix:/tmp/ianonavy-fcgi.sock; } }