Skip to content

Commit

Permalink
Avoid ugly path repetition in uwsgi config
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Oct 25, 2019
1 parent 7ef0fbf commit 526abc7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docker/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ evil-reload-on-rss = 8192

offload-threads = 4

set-placeholder = newdle-client-dir=/usr/local/lib/python3.8/site-packages/newdle/client/build

# pass urls handled by the backend to the app
route-uri = ^/(api|login|logout)/ last:
# if the request maps to a file in static, serve it
route-if = isfile:/usr/local/lib/python3.8/site-packages/newdle/client/build${PATH_INFO} static:/usr/local/lib/python3.8/site-packages/newdle/client/build${PATH_INFO}
route-if = isfile:%(newdle-client-dir)${PATH_INFO} static:%(newdle-client-dir)${PATH_INFO}
# otherwise, serve index.html which does client-side routing
route-run = static:/usr/local/lib/python3.8/site-packages/newdle/client/build/index.html
route-run = static:%(newdle-client-dir)/index.html

static-expires-type = text/html=60
static-expires = /usr/local/lib/python3.8/site-packages/newdle/client/build/static/* 2678400
static-expires = /usr/local/lib/python3.8/site-packages/newdle/client/build/favicon.ico 86400
static-expires = %(newdle-client-dir)/static/* 2678400
static-expires = %(newdle-client-dir)/favicon.ico 86400
static-gzip-all = true

0 comments on commit 526abc7

Please sign in to comment.