Skip to content

Instantly share code, notes, and snippets.

@closer27
Created December 5, 2013 13:46
Show Gist options
  • Save closer27/7805359 to your computer and use it in GitHub Desktop.
Save closer27/7805359 to your computer and use it in GitHub Desktop.
nginx conf in raspberry pi
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/var/run/php5-fpm.sock;
}
server {
## Your only path reference.
root /var/www/wordpress;
listen 80;
## Your website name goes here. Change to domain.ltd in VPS
server_name _;
access_log /var/logs/wordpress.access.log;
error_log /var/logs/wordpress.error.log;
## This should be in you http block and if it is, it's not needed here.
index index.php;
location / {
# This is cool because no php is touched for static content
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass php;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment