Removed subdir variable in favor of nginx configurations.
Added url prefix config.
Added the URL prefix to all necessary locations.
It's ugly but it works.