• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Django parameters in Plesk/nginx

Matoons

New Pleskian
Hi,
I try to run a django app on a server (Ionos) with Plesk 18.0.34 on CentOS 8.2.2004
In "Apache & nginx Settings", I put nginx directives with proxy_pass 127.0.0.1:8000 but it doesn't work . See the detail below
When I run "manage.py runserver 0.0.0.0:8000", I can access my pages with my_domain:8000, but when I run "manage.py runserver" (127.0.0.1:8000), I get ERR_CONNECTION_REFUSED.
I had the port 8000 to the firewall, and I know that after that I will use gunicorn, and not use the dev version with "runserver".

Thanks for your help

Additional nginx directives :
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8000;
break;
}
}
 
Back
Top