Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
@sanguis
sanguis / vhost.conf
Last active August 29, 2015 13:58 — forked from anonymous/nginx.conf
nginx redirecting all non ssl/www traffic to https://www...
server {
listen 443 spdy;
listen 80;
server_name foo.org www.foo.org;
root /home/site/public;
#if ($request_method !~ "^(GET|HEAD|POST)$" ) { return 444; }
if ($https != 'on') { return 301 https://www.foo.org$request_uri; }
if ($host = "foo.org") { return 301 https://www.foo.org$request_uri; }
### Password Protect /administrator area
location ~ /administrator/.* {
auth_basic "Restricted";
auth_basic_user_file /var/www/prod.pac.cr/passwd;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm: