I'm wondering how to set up a Python publishing setting for a virtual hosted site like *.tumblr.com, such as tumblr
This is the minimum configuration for nginx when using gunicorn on a single domain site.
location/{
proxy_pass:http://localhost:8000/
}
However, when running multisite using virtual hosts on nginx, moving the gunicorn first was a bottleneck, and when there were 100 sites, our stackoverflow answered that it would launch 100 gunicorn processes.Each site has a nginx configuration file and a launch script for gunicorn.I'm not sure...
It seems difficult to move multi-domain with gunicorn.
What kind of server configuration should I use to run the same Python app in multiple domains?
I was able to check the operation myself.
http://aroundthedistance.hatenadiary.jp/entry/2015/01/15/234259 to write how to do it
python nginx
If the backend program is configured to distribute sites according to the domain, you should be able to use the same configuration file as in a single domain without considering load balancing.
If server_name
is set correctly even if there is a virtual domain used for other programs or static sites, it will be allocated.
However, this only assumes that the configuration is assigned according to the domain accessed by the program by invoking the same program.You should also remember to pass the HOST in proxy_set_header
as shown in the reference link.I've never used gunicorn, so I don't know the details...
(When I reread the reference link, did you say *~ each uses a different configuration file and loads it into memory, so I can't do it with the same process *?)If that's the case, it might be right...…)
In terms of how the reverse proxy works, there should be no problem with the order in which gunicorn and Nginx start up.
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
578 Understanding How to Configure Google API Key
612 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.