-
Notifications
You must be signed in to change notification settings - Fork 6
/
kitspace.template
88 lines (73 loc) · 3.31 KB
/
kitspace.template
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
server {
listen 80;
listen [::]:80;
server_name @KITSPACE_DOMAIN;
location /robots.txt {
add_header Content-Type text/plain;
return 200 "@KITSPACE_ROBOTS_TXT";
}
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_intercept_errors on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cookie_path ~^(.+)$ '$1; domain=.@KITSPACE_DOMAIN';
proxy_pass http://frontend:3000;
}
}
server {
listen 80;
listen [::]:80;
server_name gitea.@KITSPACE_DOMAIN;
location /robots.txt {
add_header Content-Type text/plain;
return 200 "@KITSPACE_ROBOTS_TXT";
}
location ^~ / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header 'Access-Control-Allow-Origin' '@KITSPACE_URL' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' 'cache-control, pragma, user-agent, content-type, X-Csrf-Token, Authorization';
proxy_cookie_path ~^(.+)$ '$1; domain=.@KITSPACE_DOMAIN';
proxy_set_header Origin gitea.@KITSPACE_DOMAIN;
proxy_pass_request_headers on;
client_max_body_size @MAX_FILE_SIZE;
if ($request_method = OPTIONS) {
return 204;
}
proxy_pass http://gitea:3000;
}
}
server {
listen 80;
listen [::]:80;
server_name meilisearch.@KITSPACE_DOMAIN;
location /robots.txt {
add_header Content-Type text/plain;
return 200 "@KITSPACE_ROBOTS_TXT";
}
location / {
proxy_intercept_errors on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# In development mode Meilisearch sets these headers
# (Access-Control-Allow-Origin to "*", and Access-Control-Allow-Methods
# to all of GET, PUT, PATCH, DELETE... ). If we don't use `proxy_hide_header`
# then we get double headers in the HTTP responses.
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Access-Control-Allow-Methods';
add_header 'Access-Control-Allow-Origin' '@KITSPACE_URL' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS, POST';
proxy_pass http://meilisearch:7700;
}
}