• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

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