I saw you delete www and dots from database name.
Is it really needed? It seems, that you have to do it in many places of code.
Maybe we can keep database name as is.
Nginx can delete "www." before redirecting to odoo.
To allow dots in new database that is created from /web/database/manager you can apply patch as follows:
sed -i 's/matches="[^"]*"//g' addons/web/static/src/xml/base.xml