起初我像這樣設定應用程式服務器。
firstapp.json
{
"listeners": {
"*:8008": {
"pass": "applications/first"
}
},
"applications":{
"first":{
"type":"python 3.8",
"module":"firstapp.wsgi",
"home":"/home/ubuntu/anaconda3/envs/firstapp/",
"path":"/var/www/html/firstapp/current"
}
}
}
sudo curl -X PUT -d @/home/ubuntu/firstapp.json --unix-socket /run/control.unit.sock http://localhost/config
然后我想添加secondapp設定,
secondapp.json
{
"listeners": {
"*:8009": {
"pass": "applications/second"
}
},
"applications":{
"second":{
"type":"python 3.8",
"module":"secondapp.wsgi",
"home":"/home/ubuntu/anaconda3/envs/secondapp/",
"path":"/var/www/html/secondapp/current"
}
}
}
sudo curl -X PUT -d @/home/ubuntu/secondapp.json --unix-socket /run/control.unit.sock http://localhost/config
它可以注冊,但是,它會覆寫第一個設定。
如何將 seccond 應用程式添加到設定中???
uj5u.com熱心網友回復:
{
"listeners": {
"*:8008": {
"pass": "applications/first"
},
"*:8009": {
"pass": "applications/second"
}
},
"applications":{
"first":{
"type":"python 3.8",
"module":"firstapp.wsgi",
"home":"/home/ubuntu/anaconda3/envs/firstapp/",
"path":"/var/www/html/firstapp/current"
},
"second":{
"type":"python 3.8",
"module":"secondapp.wsgi",
"home":"/home/ubuntu/anaconda3/envs/secondapp/",
"path":"/var/www/html/secondapp/current"
}
}
}
只需將它們組合成一個 json
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/398119.html
標籤:Python http nginx-unit
