# https://www.nginx.com/resources/wiki/start/topics/recipes/symfony/ # NOTE: This makes any .php file other than app, app_dev and config.php # downloadable. If you want one to run, add it to the "pass the PHP scripts to # upstream FCGI" location section below. Be careful adding PHP files with # sensitive data like passwords inside them. server { listen 80; listen 8080; server_name phpci.dev.gliders.vm; root /home/gliders/code/phpci/public; error_log /var/log/nginx/phpci.error.log; access_log /var/log/nginx/phpci.access.log; location / { try_files $uri @phpci; } # pass the PHP scripts to FastCGI server from upstream phpfcgi location @phpci { fastcgi_pass phpfcgi; fastcgi_index index.php; fastcgi_buffers 256 4k; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_param SCRIPT_NAME index.php; fastcgi_param HTTPS off; } } # We don't yet have an SSL cert (not like a VM on my own machine needs one...) # server { # listen 443; # # server_name gliders.vm *.gliders.vm; # root /home/gliders/code/gliders-website/web; # # ssl on; # ssl_certificate /etc/ssl/certs/symfony2.crt; # ssl_certificate_key /etc/ssl/private/symfony2.key; # # error_log /var/log/nginx/symfony2.error.log; # access_log /var/log/nginx/symfony2.access.log; # # # strip app.php/ prefix if it is present # rewrite ^/app\.php/?(.*)$ /$1 permanent; # # location / { # index app.php; # try_files $uri @rewriteapp; # } # # location @rewriteapp { # rewrite ^(.*)$ /app.php/$1 last; # } # # # pass the PHP scripts to FastCGI server from upstream phpfcgi # location ~ ^/(app|app_dev|config)\.php(/|$) { # fastcgi_pass phpfcgi; # fastcgi_split_path_info ^(.+\.php)(/.*)$; # include fastcgi_params; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param HTTPS on; # } # }