-
Notifications
You must be signed in to change notification settings - Fork 33
/
nginx_app.conf
67 lines (54 loc) · 1.61 KB
/
nginx_app.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
error_page 404 = @handler;
error_page 405 = @handler;
index index.php index.html index.htm;
charset utf-8;
client_max_body_size 50M;
# to test nginx health
location /webserver-status {
access_log off;
return 200 'OH YEAAA';
add_header Content-Type text/plain;
break;
}
# block .composer files
location ~ composer\..* {
deny all;
log_not_found off;
}
# block node files
location ~ node_modules {
deny all;
log_not_found off;
}
# try static files first, then directory, then fall back to @handler
location / {
try_files $uri $uri/ @handler;
expires 30d;
}
# redirect requests into index.php?some/directory/thing
location @handler {
rewrite ^ /index.php?/$request_uri;
}
# handle any request starting with index.php
location ~ ^/index.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass heroku-fcgi;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param FUEL_ENV production;
fastcgi_param HTTPS 'on';
fastcgi_param PHP_VALUE "upload_max_filesize=50M \n post_max_size=50M \n memory_limit=250M \n max_execution_time=100";
include fastcgi_params;
}
# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|js|css)$ {
access_log off;
log_not_found off;
expires max;
}
# deny direct access to any php files
location ~ \.php$ {
deny all;
break;
}