Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (84 sloc) 2.69 KB
client_max_body_size 100m;
server_tokens off;
keepalive_requests 100000;
fastcgi_connect_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_ignore_client_abort on;
# http://nginx.org/en/docs/http/ngx_http_realip_module.html
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
location = / {
index index.php index.html;
}
location / {
index index.php index.html;
gzip off;
fastcgi_buffering off;
fastcgi_keep_conn on;
set $isRewrite 1;
if ($uri ~* "^/.*(assets)/.*$") {
set $isRewrite "0";
}
include /app/nginx-root/*.conf;
if ($uri !~ "^/(admin.php|middleware.php)/.*$") {
set $isRewrite "${isRewrite}1";
}
if ($isRewrite = 11) {
rewrite ^(.*)$ /index.php$1 last;
}
}
location /assets {
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_min_length 1k;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text/plain
text/javascript
text/css
text/xml
application/json
application/javascript
application/atom+xml
application/rss+xml
application/x-javascript
application/xml
application/xhtml+xml
application/x-font-ttf
image/svg+xml
;
disable_symlinks off;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location /favicon.ico {
return 204;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# try_files resets $fastcgi_path_info, see http://trac.nginx.org/nginx/ticket/321, so we use the if instead
fastcgi_param PATH_INFO $fastcgi_path_info if_not_empty;
# pass actual request host instead of localhost
fastcgi_param SERVER_NAME $host;
if (!-f $document_root$fastcgi_script_name) {
# check if the script exists
# otherwise, /foo.jpg/bar.php would get passed to FPM, which wouldn't run it as it's not in the list of allowed extensions, but this check is a good idea anyway, just in case
return 404;
}
set $my_https $https;
if ($http_x_forwarded_proto = 'https') {
set $my_https 'on';
}
fastcgi_param HTTPS $my_https; # set $_SERVER['HTTPS']
fastcgi_pass heroku-fcgi;
}
include /app/nginx/*.conf;
You can’t perform that action at this time.