Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup multiple websites with Django nginx and uwsgi?
    primarykey
    data
    text
    <p>I'm really having a tough time getting this to work properly</p> <p>In my sites enabled folder I have the following two .conf files setup</p> <p>Site A (this site I setup first and works properly):</p> <pre><code># the upstream component nginx needs to connect to upstream django { server 127.0.0.1:8001; # for a web port socket (we'll use this first) } # configuration of the server server { # the port your site will be served on listen 80; # the domain name it will serve for server_name databank.eaventures.co www.databank.eaventures.co ; # substitute your mac$ charset utf-8; access_log /srv/www/*****/logs/access.log; error_log /srv/www/*****/logs/error.log; # max upload size client_max_body_size 75M; # adjust to taste # Django media location /media { alias /srv/www/******/projectdatabank/media; # your Django project's m$ } location /static { alias /srv/www/******/projectdatabank/static; # your Django project's s$ } # Finally, send all non-media requests to the Django server. location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed } } </code></pre> <p>Site B (the new site I am trying to add but not getting to work):</p> <pre><code># the upstream component nginx needs to connect to upstream django2 { server 127.0.0.1:8002; # for a web port socket (we'll use this first) } # configuration of the server server { # the port your site will be served on listen 80; # the domain name it will serve for server_name 50.116.47.120 ***.eaventures.co ; # substitute your machine's IP add$ charset utf-8; access_log /srv/www/***.capital.com/logs/access.log; error_log /srv/www/***capital.com/logs/error.log; # max upload size client_max_body_size 75M; # adjust to taste # Django media location /media { alias /srv/www/***capital.com/***/media; # your Django project's media$ } location /static { alias /srv/www/***capital.com/***/static; # your Django project's stati$ } # Finally, send all non-media requests to the Django server. location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed } } </code></pre> <p>to start uwsgi I ran the following command (in actuality I run an emperor command however I'd like to tackle one issue at a time here), when I run this site A works completely fine</p> <pre><code>uwsgi --socket :8001 --chdir /srv/www/.com/projectdatabank/ --wsgi-file /srv/www/.com/projectdatabank/databank/wsgi.py </code></pre> <p>Now I run this to try and start site B</p> <pre><code>uwsgi --socket :8002 --chdir /srv/www/***capital.com/***/ --wsgi-file /srv/www/***capital.com/***/***/wsgi.py </code></pre> <p>When I go to the ip address (set on site B) it runs the site django app but does not pull in the css files</p> <p>any thoughts??</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.
 

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