equal
deleted
inserted
replaced
|
1 upstream {{backend_upstream_name}} { |
|
2 server {{backend_host}}:{{backend_port}}; |
|
3 server 127.0.0.1 backup; |
|
4 } |
|
5 |
|
6 |
|
7 server { |
|
8 listen 80; |
|
9 listen [::]:80; |
|
10 |
|
11 server_name {{static_server_name}}; |
|
12 |
|
13 access_log /var/log/nginx/{{static_server_name}}-access.log; |
|
14 error_log /var/log/nginx/{{static_server_name}}-error.log; |
|
15 |
|
16 root {{remote_static_path}}/; |
|
17 index index.html index.htm; |
|
18 |
|
19 |
|
20 location {{backend_url}}/api { |
|
21 uwsgi_pass {{backend_upstream_name}}; |
|
22 include /etc/nginx/uwsgi_params; |
|
23 } |
|
24 location {{backend_url}}/admin { |
|
25 uwsgi_pass {{backend_upstream_name}}; |
|
26 include /etc/nginx/uwsgi_params; |
|
27 } |
|
28 location {{backend_url}}/auth { |
|
29 uwsgi_pass {{backend_upstream_name}}; |
|
30 include /etc/nginx/uwsgi_params; |
|
31 } |
|
32 |
|
33 location /backend/static { |
|
34 alias {{backend_nginx_static_root}}; # backend static files |
|
35 } |
|
36 |
|
37 location /backend/media { |
|
38 alias {{backend_nginx_media_root}}; # backend media files |
|
39 } |
|
40 |
|
41 location / { |
|
42 # First attempt to serve request as file, then |
|
43 # as directory, then fall back to displaying a 404. |
|
44 try_files $uri $uri/ /index.html; |
|
45 } |
|
46 } |