Reputation: 47
I'm trying to deploy a Django application using Nginx and uWSGI on a Linux system (WSL2), but I'm encountering an issue where Nginx serves its default page instead of my Django application. I've confirmed that uWSGI is running and my Django app is functional by itself.
Here's my current setup:
Nginx Configuration:
server {
listen 80;
server_name localhost;
charset utf-8;
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass unix:/var/run/uwsgi.webapppackage/master.sock;
}
}
uWSGI Configuration (uwsgi.ini):
[uwsgi]
chdir = /mnt/c/Python/WonderPasNavi/wonderpasnavi
home = /mnt/c/Python/WonderPasNavi/wonderpasnavi/.venv
wsgi-file = /mnt/c/Python/WonderPasNavi/wonderpasnavi/wsgi.py
module = wonderpasnavi.wsgi:application
logto = /mnt/c/Python/WonderPasNavi/wonderpasnavi/uwsgi-my_app.log
master = true
vacuum = true
pidfile = /var/run/uwsgi.webapppackage/master.pid
socket = /var/run/uwsgi.webapppackage/master.sock
processes = 2
die-on-term = true
touch-reload = /mnt/c/Python/WonderPasNavi/reload.trigger
lazy-apps = true
Symptoms:
Nginx serves the "Welcome to nginx!" page instead of the Django app. uWSGI logs indicate it's running without errors. No relevant errors in Nginx logs. I've tried restarting Nginx and uWSGI, checking the symlink in /etc/nginx/sites-enabled/, and clearing browser cache but no success. Could there be a configuration issue I'm overlooking, or is there a specific setting required for Nginx to properly forward requests to uWSGI?
Any suggestions or guidance would be greatly appreciated!
Upvotes: 0
Views: 35