Answer the question
In order to leave comments, you need to log in
How to do dynamic subdomain handling on flask?
Let the domain be domain.com
I have a web server on flask located at localhost:8080.
There is also nginx.
The whole thing is hidden under cloudflare and works great, but I need users to be able to add their own pages like page.domain.com, and at the same time flask handles it adequately. Googling, I found out that flask can do this:
@app.route('/somepage', subdomain='<subdomain>')
def handler(subdomain):
...
server {
listen 80;
server_name *.domain.com;
location / {
proxy_pass http://localhost:8080;
}
}
Answer the question
In order to leave comments, you need to log in
https://stackoverflow.com/questions/7512698/flask-...
see about hosts there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question