Commit aa8e609f authored by Owain Jones's avatar Owain Jones
Browse files

update for symfony framework

parent d896742e
# Configuration for the gliders website -- set it up to use php-fpm etc. # 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.
upstream phpfcgi {
server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server { server {
listen 80; listen 80;
listen 8080; listen 8080;
root /home/gliders/www;
index index.php index.html index.htm;
server_name _; # update with actual hostname when we get it
location / { server_name *.gliders.vm;
try_files $uri $uri/ /index.html; root /home/gliders/web;
}
error_page 404 /404.html; error_log /var/log/nginx/gliders.error.log;
error_page 500 502 503 504 /50x.html; access_log /var/log/nginx/gliders.access.log;
# Serve static files directly # strip app.php/ prefix if it is present
location ~* \.(png|jpe?g|gif|ico)$ { rewrite ^/app\.php/?(.*)$ /$1 permanent;
expires 1y;
access_log off; location / {
try_files $uri $uri/ @rewrite; index app.php;
gzip off; try_files $uri @rewriteapp;
} }
location ~* \.(css|js)$ {
expires 1d; location @rewriteapp {
access_log off; rewrite ^(.*)$ /app.php/$1 last;
} }
location ~ \.php$ { # pass the PHP scripts to FastCGI server from upstream phpfcgi
try_files $uri =404; location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass phpfcgi;
fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
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;
# root /home/gliders/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;
# }
# }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment