Skip to content

Instantly share code, notes, and snippets.

@rolandboon
Created January 31, 2014 12:54
Show Gist options
  • Save rolandboon/8731623 to your computer and use it in GitHub Desktop.
Save rolandboon/8731623 to your computer and use it in GitHub Desktop.
server {
server_name pgadmin.example.com; # Make sure to create a DNS record that refers to your droplet
root /home/deploy/phppgadmin;
allow 123.123.123.123; # Limit access based on IP
deny all;
location / {
index index.php;
try_files $uri $uri/ /index.php; # http://wiki.nginx.org/Pitfalls#Check_IF_File_Exists
}
location ~ \.php$ {
try_files $uri =404; # http://wiki.nginx.org/Pitfalls#Passing_Uncontrolled_Requests_to_PHP
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # http://wiki.nginx.org/Pitfalls#FastCGI_Path_in_Script_Filename
include /etc/nginx/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment