diff --git a/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf b/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf
index 2b1f1bf688..5398bb1271 100644
--- a/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf
+++ b/roles/pagure/upstreamfirst-frontend/templates/0_pagure.conf
@@ -78,6 +78,16 @@ WSGIDaemonProcess paguredocs user=git group=git maximum-requests=1000 display-na
git-(upload|receive)-pack))$" \
/usr/libexec/git-core/git-http-backend/$1
+ # Configure static files so that a custom theme can override the defaults
+
+ RewriteCond "{{ pagure_theme_static_dir }}/$1" -f
+ RewriteRule "^/static/(.*)" "{{ pagure_theme_static_dir }}/$1" [L]
+
+ # Use the application default theme for files not customized
+
+ RewriteRule "^/static/(.*)" "/usr/lib/python2.7/site-packages/pagure/static/$1" [L]
+
+
WSGIProcessGroup pagure