Skip to content

Instantly share code, notes, and snippets.

@luissquall
Last active March 16, 2016 19:09
Show Gist options
  • Save luissquall/55418951778a40d05364 to your computer and use it in GitHub Desktop.
Save luissquall/55418951778a40d05364 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name {{ hostname }};
client_max_body_size 10M;
root /var/www/{{ hostname }};
index index.php index.html index.htm;
access_log /var/log/nginx/{{ hostname }}.access.log;
error_log /var/log/nginx/{{ hostname }}.error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location /phpmyadmin {
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/htpasswd/{{ hostname }};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment