14👍
If you have other configuration files in the directory(/etc/nginx/sites-enabled/django
) with same upstream name as ‘app_server ‘ then you get that duplicate upstream error.
So replace ‘app_server’ to any other name. run nginx -t
to check for any errors, then restart nginx,
1👍
If you tape in your terminal cat /etc/nginx/nginx.conf
you will see these two lines:
include /etc/nginx/conf.d/*.conf;
Wich means Nginx load all files
.conf (for example if you are using dokku to deploy your app, you will see dokku.conf which contain "include /home/dokku/*/nginx.conf;" itself)
and this means loading all /home/dokku/whatever-folder/nginx.conf
include /etc/nginx/sites-enabled/*;
- [Django]-How can I know if a email is sent correctly with Django/Python?
- [Django]-Getting Django's staticfiles includes working inside Vue.js .vue templates
- [Django]-NameError: name PositiveSmallIntegerField is not defined
- [Django]-Unable to bound form data after upgrading to django 1.5.1
1👍
If the same upstream name "app_server" is not found, find the same upstream name with different case,like:
upstream app_server {
server 127.0.0.1:9000
}
upstream App_server {
server 127.0.0.1:9000
}
This may also cause conflicts. It may be the setting of nginx, but I haven’t found the document yet
- [Django]-Django + jQuery: Why CSRF verification fails on multiple simultaneous requests
- [Django]-How much flexibility is there in a Django for loop?
- [Django]-Django Channels stops working with self.receive_lock.locked error
- [Django]-Django AllAuth gives SSLError
- [Django]-Django creates the test database for Postgresql with incorrect sequences start values
0👍
This problem came up in my case because my configuration file was in /etc/nginx/conf.d
and I also had a symbolic link to it in /etc/nginx/sites-enabled/
. Not sure how nginx
loads the files but apparently it was loaded twice. No matter what name I chose for the upstream, I got duplicate error. Deleting symbolic link fixed the problem.
- [Django]-Upload image files with specific directory structure to amazon s3 django
- [Django]-Create Docker container with Django, npm and gulp
- [Django]-Displaying pyqtgraph and pyqt widgets on web
- [Django]-Remove a migration from south migration history