Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mychalvlcek/fd4d16fc89b24767e7cae90830f9c85d to your computer and use it in GitHub Desktop.
Save mychalvlcek/fd4d16fc89b24767e7cae90830f9c85d to your computer and use it in GitHub Desktop.
nginx (brew) configuration with php70-fpm, with symfony based example vhost
brew install nginx # install nginx
brew install php70 --with-fpm --with-imap --without-apache # install php
sudo nginx -s reload # to run with (port 80) you have to run as sudo
sudo brew services restart php70-fpm # restart php-fpm
# /usr/local/etc/nginx/sites-enabled/example.conf
server {
listen 80;
server_name example.loc;
root /var/www/symfony-standard/web;
index app.php;
include /usr/local/etc/nginx/symfony.conf;
}
# /usr/local/etc/nginx/symfony.conf
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment