-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
90 lines (78 loc) · 2.39 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
daemon off;
error_log /dev/stdout info;
worker_processes 1;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /dev/stdout combined;
sendfile on;
upstream api {
server unix:/srv/api/gunicorn.sock;
}
upstream openfoodfacts {
server unix:/srv/off/gunicorn.sock;
}
upstream ooshop {
server unix:/srv/ooshop/gunicorn.sock;
}
upstream autoappro {
server unix:/srv/autoappro/gunicorn.sock;
}
server {
listen 8000 default;
server_name _;
charset utf-8;
client_max_body_size 75M;
root /srv/client;
index index.html;
location /api/static {
alias /srv/api/static;
break;
}
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header SCRIPT_NAME /api;
proxy_pass http://api;
proxy_redirect off;
break;
}
location /off {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header SCRIPT_NAME /off;
proxy_pass http://openfoodfacts;
add_header Access-Control-Allow-Origin *;
proxy_redirect off;
break;
}
location /ooshop {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header SCRIPT_NAME /ooshop;
proxy_pass http://ooshop;
add_header Access-Control-Allow-Origin *;
proxy_redirect off;
break;
}
location /autoappro {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header SCRIPT_NAME /autoappro;
proxy_pass http://autoappro;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers 'accept, content-type, Authorization';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
proxy_redirect off;
break;
}
location / {
try_files $uri$args $uri /index.html;
}
}
}