Skip to content

Instantly share code, notes, and snippets.

@holachek
Created December 31, 2011 04:11
Show Gist options
  • Save holachek/1542837 to your computer and use it in GitHub Desktop.
Save holachek/1542837 to your computer and use it in GitHub Desktop.
PHP doesn't work using this nginx.conf file
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
server {
listen 80;
server_name www.site.com site.com;
#charset koi8-r;
access_log /srv/www/site.com/logs/access.log;
error_log /srv/www/site.com/logs/error.log;
root /srv/www/site.com/public_html;
location / {
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
if ($uri !~ "^/images/") {
fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
}
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/site.com/public_html$fastcgi_script_name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment