-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsop_nginx.conf
55 lines (46 loc) · 1.87 KB
/
sop_nginx.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
server {
listen 80;
server_name be-web.ru *.be-web.ru;
charset utf-8;
#access_log logs/host.access.log main;
# Get people onto the non-www site
if ($host = 'www.example.com' ) {
rewrite ^/(.*)$ http://example.com/$1 permanent;
}
# project media assuming it's called at media/
# keep in mind that media/ will be maintained as a directory by the root command
location ^~ /static/ {
root /var/www/src/constructor/;
}
# admin uses admin-media/
# alias works different than root above by dropping admin-media
#location ^~ /admin-media/ {
# alias /var/lib/python-support/python2.6/django/contrib/admin/media/;
#}
location / {
# host and port to fastcgi server
fastcgi_pass 127.0.0.1:10080;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
# todo: setup 404 for the /media directory.
# / directory will be handled by django url dispatcher
#error_page 404 /404.html;
#location = /404.html {
# root /var/www/nginx-default;
#}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}