Skip to content

Instantly share code, notes, and snippets.

@fer-ri
Last active December 29, 2016 14:37
Show Gist options
  • Save fer-ri/f27df1d9577688a8d7ea to your computer and use it in GitHub Desktop.
Save fer-ri/f27df1d9577688a8d7ea to your computer and use it in GitHub Desktop.
Default Nginx Conf Debian / Ubuntu
server {
listen 80;
root /home/nginx/domains/default/public_html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
@fer-ri
Copy link
Author

fer-ri commented Oct 28, 2015

Post Installation

Add nginx user

useradd -s /bin/false nginx
mkdir -p /home/nginx/domains/default/{logs,public_html}
chown -R nginx: /home/nginx

PHP FPM

  • Buka /etc/php5/fpm/pool.d/www.conf
  • Ubah www-data menjadi user owner pada listen-user, listen-group, listen-port
  • Ubah php5-fpm-www-data.sock meniadi php5-fpm.sock

NGINX

  • Buka /etc/nginx/nginx.conf, ubah www-data menjadi user owner

OpenVPN

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-8

Done ..

@fer-ri
Copy link
Author

fer-ri commented Nov 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment