Skip to content

Instantly share code, notes, and snippets.

@lovelock
Created November 29, 2016 08:07
Show Gist options
  • Save lovelock/92bbad259007f2f515834bf58cd95870 to your computer and use it in GitHub Desktop.
Save lovelock/92bbad259007f2f515834bf58cd95870 to your computer and use it in GitHub Desktop.
A simple PHP nginx vhost
server {
listen 80;
server_name example.com;
error_log /data/log/php/htdocs/error.log;
access_log /data/log/php/htdocs/access.log;
root /data/web/htdocs/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment