server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
server_name tmf.4rc.io;
ssl_certificate /etc/nginx/ssl/tmf.crt;
ssl_certificate_key /etc/nginx/ssl/tmf.key;
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
root /usr/local/zend/tmf/public;
index index.php;
# Make site accessible from http://localhost/
server_name tmf.4rc.io;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
rewrite '^(.*)\.[\d]{10}\.(css|js)$' $1.$2 last;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param APPLICATION_ENV "staging";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Block access to .htaccess
location ~ \.htaccess {
deny all;
}
}