Note that there are some explanatory texts on larger screens.

plurals
  1. POnginx+uwsgi+django, Error 502 when deploy multi-apps, help me
    primarykey
    data
    text
    <p>The whole thing works well when there is only one django project, but when i create another django project and want to add it to nginx with the previous one, only one can work , the other one show 502 error.</p> <p>The nginx config:</p> <pre><code>server{ listen 80; root /root/www; server_name 119.254.35.221; location /{ uwsgi_pass 127.0.0.1:8000; include uwsgi_params; uwsgi_param UWSGI_SCRIPT www.wsgi; uwsgi_param UWSGI_CHDIR /root/www; uwsgi_param UWSGI_PYHOME /root/www; uwsgi_param SCRIPT_NAME ""; } } server{ listen 81; root /root/www1; server_name 119.254.35.221; location / { uwsgi_pass 127.0.0.1:8000; include uwsgi_params; uwsgi_param UWSGI_SCRIPT www1.wsgi; uwsgi_param UWSGI_CHDIR /root/www1; uwsgi_param UWSGI_PYHOME /root/www1; uwsgi_param SCRIPT_NAME ""; } } </code></pre> <p>the uwsgi.ini:</p> <pre><code>[uwsgi] uid = 500 listen=200 master = true profiler = true processes = 8 logdate = true socket = 127.0.0.1:8000 pidfile = /root/www/www.pid daemonize = /root/www/www.log enable-threads = true memory-report = true limit-as = 6048 And I create two project: 1, www: django-admin.py startproject www 2, www1: django-admin.py startproject www1 Then I start nginx and uwsgi: 1, ngxin 2, uwsgi --ini uwsgi.ini --vhost </code></pre> <p>In the end, i visit 119.254.35.221:80 and 119.254.35.221:81, only one of them(may be port 80 or 81) works well, the other one show ERROR:502.</p> <p>Help me , i'm gonna crazy..</p> <pre><code>server { listen 80; server_name customersite1.com www.customersite1.com; access_log /var/log/customersite1/access_log; location / { root /var/www/customersite1 uwsgi_pass 127.0.0.1:3031; include uwsgi_params; } } server { listen 80; server_name customersite2.com www.customersite2.com; access_log /var/log/customersite2/access_log; location / { root /var/www/customersite2 uwsgi_pass 127.0.0.1:3032; include uwsgi_params; } } server { listen 80; server_name pippo.com; access_log /var/log/pippo/access_log; location / { root /var/www/pippohome uwsgi_pass 127.0.0.1:3033; include uwsgi_params; } } Now you have to run the customer's applications (you can use rc.local or upstart or whetever you want) with a different uid and a limited (if you want) address space for each socket: uwsgi --uid 1001 -w customer1app --limit-as 128 -p 3 -M -s 127.0.0.1:3031 uwsgi --uid 1002 -w customer2app --limit-as 128 -p 3 -M -s 127.0.0.1:3032 uwsgi --uid 1003 -w django3app --limit-as 96 -p 6 -M -s 127.0.0.1:3033 </code></pre> <p>I follow the official method to solve this, but is there any workaround here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload