nginx error: worker_connections are not enough daphne Django channels supervisor

I have a Django 2.1 application using Django Channels v2 running on daphne, nginx and supervisor.

I have scoured through all SO forums and tried all of the correct answers (such as changing localhost to 127.0.0.1, changing proxy_pass value to myapp.com but have been unable to resolve this error.

sudo less /var/log/nginx/error.log shows

2019/02/25 16:31:08 [alert] 7154#7154: *13731 768 worker_connections are not enough while connecting to upstream, client: 127.0.0.1:8000, server: myapp.com, request: "GET / HTTP/1.1", upstream: "http:/127.0.0.1:8000/", host: "www.myapp.com" 

I’ve tried increasing the worker_connections but I get a connection refused too many loop.

My server block located at /etc/nginx/sites-available/myapp

upstream channels-backend {     server 127.0.0.1:8000; }  server {     listen 127.0.0.1:8000;     server_name myapp.com www.myapp.com;      location = /favicon.ico { access_log off; log_not_found off; }      location / {         try_files $  uri @proxy_to_app;     }      location /static/ {         root /home/user/myapp/src/myapp;     }      location /media/  {         root /home/user/myapp/src/myapp;         include /etc/nginx/mime.types;     }      location @proxy_to_app {         proxy_pass http://channels-backend;          proxy_http_version 1.1;         proxy_set_header Upgrade $  http_upgrade;         proxy_set_header Connection "upgrade";          proxy_redirect off;         proxy_set_header Host $  host;         proxy_set_header X-Real-IP $  remote_addr;         proxy_set_header X-Forwarded-For $  proxy_add_x_forwarded_for;         proxy_set_header X-Forwarded-Host $  server_name; } 

my supervisor configuration file

[fcgi-program:asgi] # TCP socket used by Nginx backend upstream socket=tcp://127.0.0.1:8000  # Directory where your site's project files are located directory=/home/user/myapp/src/myapp  # Each process needs to have a separate socket file, so we use process_num # Make sure to update "mysite.asgi" to match your project name command=daphne -u home/user/daphne/run/daphne%(process_num)d.sock --fd 0 --access-log - --prox$    # Number of processes to startup, roughly the number of CPUs you have numprocs=4  # Give each process a unique name so they can be told apart process_name=asgi%(process_num)d  # Automatically start and recover processes autostart=true autorestart=true  # Choose where you want your log to go stdout_logfile=/home/user/daphne/logs/asgi.log redirect_stderr=true 

running sudo journalctl -u nginx gives

Feb 25 xxx myapp systemd[1]: Started A high performance web server and a reverse proxy server. 

If I have missed some info, let me know and I will edit the question. Many thanks!