Setting up Django on web server with nginx and uWSGI

I am following this guide in order to set up one Django app with nginx.

I have installed Nginx and I can access it on or

I have this configuration file:

upstream django {     # connect to this socket     server;     }  server {     # the port your site will be served on     listen 8000 default_server;     listen [::]:8000 default_server;      server_name;      charset     utf-8;      #Max upload size     client_max_body_size 75M;   # adjust to taste      # Django media     location /media  {         alias /home/dwv/Documents/FMQDjango/BetApp/media;     }      location /static {         alias /home/dwv/Documents/FMQDjango/BetApp/static;     }      location / {         uwsgi_pass  django;         include     /etc/nginx/uwsgi_params;     } } 

I have symlinked this file to /etc/nginx/sites-enabled/

I still can access the "welcome message" on but i cannot connect to

I have a file called porto.jpg on my media folder, then I try to access it on but i still cannot connect to server.

Anyone knows what is the problem?


Problem solved!

I don't even know why I was getting that error.

What I was doing:

  • Create an empty file on my Project root folder;
  • Edit the file on Sublime with the code I pasted on my question;
  • ERROR. Do not work.

What I did to solve it:

  • sudo nano /etc/nginx/sites-available/myconf;
  • The previous command opens an editor;
  • Write the same code on the terminal Editor;
  • It worked!

The code is the same, I don't know why, on first approach it do not work.

Category: nginx Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.196 (s). 12 q(s)