Skip to content

Commit 376afb3

Browse files
committedSep 11, 2016
uwsgi and Nginx configuration added along with minor change in settings file
1 parent 8746bb9 commit 376afb3

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed
 

‎ide/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
# https://docs.djangoproject.com/en/1.9/howto/static-files/
128128

129129
STATIC_URL = '/static/'
130+
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
130131

131132
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
132133
MEDIA_URL = '/media/'

‎ide_nginx.conf

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ide_nginx.conf
2+
3+
# the upstream component nginx needs to connect to
4+
upstream django {
5+
server 127.0.0.1:8000; # for a web port socket (we'll use this first)
6+
}
7+
8+
# configuration of the server
9+
server {
10+
# the port your site will be served on
11+
listen 80;
12+
# the domain name it will serve for
13+
server_name 54.163.53.189; # substitute your machine's IP address or FQDN
14+
charset utf-8;
15+
16+
# max upload size
17+
client_max_body_size 75M; # adjust to taste
18+
19+
# Django media
20+
location /media {
21+
alias /home/ubuntu/viraj/IDE/media; # your Django project's media files - amend as required
22+
}
23+
24+
location /static {
25+
alias /home/ubuntu/viraj/IDE/static; # your Django project's static files - amend as required
26+
}
27+
28+
# Finally, send all non-media requests to the Django server.
29+
location / {
30+
uwsgi_pass django;
31+
include /home/ubuntu/viraj/IDE/uwsgi_params; # the uwsgi_params file you installed
32+
}
33+
}

‎ide_uwsgi.ini

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[uwsgi]
2+
3+
chdir = /home/ubuntu/viraj/IDE
4+
wsgi-file = /home/ubuntu/viraj/IDE/ide/wsgi.py
5+
master = true
6+
processes = 10
7+
socket = 0.0.0.0:8000
8+
vaccum = true
9+
python-autoreload = 1
10+
# buffer-size=32768
11+
daemonize = /var/log/uwsgi/ide.log
12+

‎uwsgi_params

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
uwsgi_param QUERY_STRING $query_string;
2+
uwsgi_param REQUEST_METHOD $request_method;
3+
uwsgi_param CONTENT_TYPE $content_type;
4+
uwsgi_param CONTENT_LENGTH $content_length;
5+
6+
uwsgi_param REQUEST_URI $request_uri;
7+
uwsgi_param PATH_INFO $document_uri;
8+
uwsgi_param DOCUMENT_ROOT $document_root;
9+
uwsgi_param SERVER_PROTOCOL $server_protocol;
10+
uwsgi_param HTTPS $https if_not_empty;
11+
12+
uwsgi_param REMOTE_ADDR $remote_addr;
13+
uwsgi_param REMOTE_PORT $remote_port;
14+
uwsgi_param SERVER_PORT $server_port;
15+
uwsgi_param SERVER_NAME $server_name;
16+

0 commit comments

Comments
 (0)
Please sign in to comment.