/
nginx.conf
41 lines (35 loc) · 1.28 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Domain Specific Config
# location: /var/www/DOMAIN.com/conf/nginx.conf
#
server {
listen IP_ADDRESS_HERE:80;
server_name DOMAIN.com;
root /var/www/DOMAIN.com/public/;
index index.php index.html;
fastcgi_index index.php;
access_log /var/www/DOMAIN.com/log/access.log;
error_log /var/www/DOMAIN.com/log/error.log warn;
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location / {
# If the file exists as a static file serve it
# directly without running all
# the other rewite tests on it
if ($request_filename ~ "favicon\.ico$") {
break;
}
if (-e $request_filename) {
break;
}
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
}