Skip to content

Commit

Permalink
now using nginx and subfolder app
Browse files Browse the repository at this point in the history
  • Loading branch information
joseafga committed Mar 23, 2019
1 parent f281999 commit 3553b1b
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .htaccess

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: vendor/bin/heroku-php-nginx -C nginx_app.conf public/
48 changes: 48 additions & 0 deletions nginx_app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
index index.php index.html;
charset UTF-8;
default_type text/html;

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_min_length 10;
gzip_http_version 1.1;
gzip_types application/json;

client_max_body_size 10M;

location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}

location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /v1/index.php/?req=$1 last;
}

location /api {
rewrite ^/api\/v1\/processes[\/]?$ /v1/processes.php;
rewrite ^/api\/v1\/processes\/([0-9]+)[\/]?$ /v1/process.php?id=$1;
rewrite ^/api\/v1\/processes\/([0-9]+)\/tags[\/]?$ /v1/process_tags.php?id=$1;
rewrite ^/api\/v1\/processes\/([0-9]+)\/timeline[\/]?$ /v1/process_timeline.php?id=$1;
rewrite ^/api\/v1\/tags\/([0-9]+)[\/]?$ /v1/tag.php?id=$1;
rewrite ^/api\/v1\/tags\/([0-9]+)\/records[\/]?$ /v1/tag_records.php?id=$1;
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location ~* \.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
try_files $uri =404;
expires max;
add_header Pragma "public";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3553b1b

Please sign in to comment.