# the upstream component nginx needs to connect to
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:49152; # for a web port socket (we’ll use this first)
}
upstream django_web {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:49153; # for a web port socket (we’ll use this first)
}
#upstream django_api {
# server 127.0.0.1:49154;
#}
server {
listen 80;
server_name localhost;
return 301 https://$server_name$request_uri;
}server {
listen 80;
server_name localhost;
client_max_body_size 10M; # adjust to taste
location / {
uwsgi_pass django_web;
include /home/ubuntu/projectname/confs/uwsgi_params; # the uwsgi_params file you installed
}
}server {
listen 443;
charset utf-8;
server_name localhost;
ssl on;
ssl_certificate /etc/nginx/ssl/projectname/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
# max upload size
client_max_body_size 10M; # adjust to taste
location / {
uwsgi_pass django_web;
include /home/ubuntu/projectname/confs/uwsgi_params; # the uwsgi_params file you installed
}
}
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:49152; # for a web port socket (we’ll use this first)
}
upstream django_web {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:49153; # for a web port socket (we’ll use this first)
}
#upstream django_api {
# server 127.0.0.1:49154;
#}
server {
listen 80;
server_name localhost;
return 301 https://$server_name$request_uri;
}server {
listen 80;
server_name localhost;
client_max_body_size 10M; # adjust to taste
location / {
uwsgi_pass django_web;
include /home/ubuntu/projectname/confs/uwsgi_params; # the uwsgi_params file you installed
}
}server {
listen 443;
charset utf-8;
server_name localhost;
ssl on;
ssl_certificate /etc/nginx/ssl/projectname/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
# max upload size
client_max_body_size 10M; # adjust to taste
location / {
uwsgi_pass django_web;
include /home/ubuntu/projectname/confs/uwsgi_params; # the uwsgi_params file you installed
}
}
server {
listen 80;
charset utf-8;
server_name localhost;
# log_format compression ‘$remote_addr – $remote_user [$msec]’
# ‘”$request” $status $body_bytes_sent ‘
# ‘”$http_referer” “$http_user_agent” “$gzip_ratio”‘;
# access_log /home/ubuntu/api-logs/access.log compression;
access_log /home/ubuntu/log/nginx/access.log;
# max upload size
client_max_body_size 10M; # adjust to taste
location / {
uwsgi_pass django;
include /home/ubuntu/projectname/confs/uwsgi_params; # the uwsgi_params file you installed
}
}
location /static/ {
alias /home/ubuntu/projectname/static/;
alias /home/ubuntu/projectname/static/;
}
#server {
# listen 9000;
# charset utf-8;
# server_name 52.68.207.155;
# access_log /home/ubuntu/project2/access.log compression;
# client_max_body_size 10M; # adjust to taste
# location / {
# uwsgi_pass django_api;
# include /home/ubuntu/project2name/confs/uwsgi_params; # the uwsgi_params file you installed
# }
# listen 9000;
# charset utf-8;
# server_name 52.68.207.155;
# access_log /home/ubuntu/project2/access.log compression;
# client_max_body_size 10M; # adjust to taste
# location / {
# uwsgi_pass django_api;
# include /home/ubuntu/project2name/confs/uwsgi_params; # the uwsgi_params file you installed
# }
#}