Last active
July 5, 2016 15:49
-
-
Save mychalvlcek/fd4d16fc89b24767e7cae90830f9c85d to your computer and use it in GitHub Desktop.
nginx (brew) configuration with php70-fpm, with symfony based example vhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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