diff --git a/postgresql/phppagadmin/ubuntu 16.04 - How to install postgresql and phppgadmin with nginx - Stack Overflow.md b/postgresql/phppagadmin/ubuntu 16.04 - How to install postgresql and phppgadmin with nginx - Stack Overflow.md new file mode 100644 index 0000000..1b15e98 --- /dev/null +++ b/postgresql/phppagadmin/ubuntu 16.04 - How to install postgresql and phppgadmin with nginx - Stack Overflow.md @@ -0,0 +1,29 @@ +**Setup Nginx** + +First, lets add a symbolic link to the directory where you intend to place all your web files in. + +``` +sudo ln -s /usr/share/webapps/phppgadmin /path/to/your/www +``` + +Next, lets create a server block for phpPgAdmin. Create a file /etc/nginx/sites-available/phppgadmin with the following contents. + +``` +# Server block for phppgadmin service +server{ + server_name phppgadmin.example.com; + root /path/to/your/www/phppgadmin; + + access_log /var/log/phppgadmin/access.log; + error_log /var/log/phppgadmin/error.log; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /path/to/your/www/postgres$fastcgi_script_name; + include /etc/nginx/fastcgi_params; + } +} +``` \ No newline at end of file