edoceo

How To: Nginx + PHP

Install Nginx & PHP

apt-get install nginx
apt-get install php5-fpm php5-curl php5-memcached php5-redis

Configure Nginx

server {
	listen 80 default_server;
	listen [::]:80 default_server ipv6only=on;

	root /usr/share/nginx/html;
	index index.html index.htm;

	# Make site accessible from http://localhost/
	server_name localhost;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
		# Uncomment to enable naxsi on this location
		# include /etc/nginx/naxsi.rules
	}
}

Loading Comments from Disqus...