-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx-app.conf
42 lines (34 loc) · 1.47 KB
/
nginx-app.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# nginx-app.conf
server {
# the port your site will be served on, default_server indicates that this server block
# is the block to use if no blocks match the server_name
listen 80 default_server;
# the domain name it will serve for
# server_name 127.0.0.1; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 512M; # adjust to taste
#if ($http_x_forwarded_proto != 'https') {
#rewrite ^ https://$host$request_uri? permanent;
#}
# Django media
location /media {
alias /project/django_gunicorn/django_gunicorn/media; # your Django project's media files - amend as required
}
location /static {
alias /project/django_gunicorn/django_gunicorn/static; # your Django project's static files - amend as required
}
# disable all robots
location /robots.txt {
return 200 "User-agent: *\nDisallow: /";
}
# Finally, send all non-media requests to the Django server.
location / {
include proxy_params;
proxy_pass http://unix:/project/django_gunicorn.sock;
proxy_buffering off;
}
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
}