-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
43 lines (32 loc) · 983 Bytes
/
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
upstream backend {
server imagebed-server:8000;
}
client_max_body_size 800m;
server {
listen 80;
server_name localhost;
access_log off;
error_log /var/log/nginx/error.log;
location ~* /api {
proxy_pass http://backend;
proxy_redirect off;
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;
# cors
# if ($http_origin ~ ^engigu){
add_header Access-Control-Allow-Origin '*';
# add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
if ($request_method = 'OPTIONS') {
return 204;
}
# }
}
location / {
root /usr/share/nginx/html;
}
location ~* \.(js|jpg|png|css){
root /usr/share/nginx/html;
}
}