Flask static settings:
app = Flask(__name__.split('.')[0], static_folder=None)
app.static_url_path = '/static'
app.static_folder = 'static'
app.add_url_rule(app.static_url_path + '/<path:filename>',
endpoint='static',
view_func=app.send_static_file)
CSS
@font-face {
font-family: MuiiconSpread;
font-weight: normal;
font-style: normal;
src: url('../fonts/icons.ttf') format('truetype');
}
JS
require.config({
paths: {
'jquery': '/static/plugins/jquery-3.3.1/jquery.min',
},
});
While access the subdomain such as: a.test.com, the icons.ttf and jquery.min.js are 404 error.
When I add subdomain='a' in add_url_rule for static, everything will be fine. But it just matches a.test.com, while access b.test.com should change the same config to subdomain='b'.
How to fix it?