-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
68 lines (54 loc) · 1.76 KB
/
nginx.conf
File metadata and controls
68 lines (54 loc) · 1.76 KB
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
worker_processes auto;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
upstream app_cluster {
least_conn;
server app1:8080;
server app2:8080;
server app3:8080;
}
server {
listen 80;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always;
add_header Access-Control-Allow-Headers "*" always;
if ($request_method = OPTIONS) {
return 204;
}
location /swagger-ui/ {
alias /usr/share/nginx/html/swagger-ui/;
try_files $uri $uri/ /swagger-ui/index.html;
}
location /openapi.yml {
alias /usr/share/nginx/html/openapi.yml;
}
location /v3/api-docs {
proxy_pass http://app_cluster$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /swagger-resources/ {
proxy_pass http://app_cluster$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
proxy_pass http://app_cluster;
proxy_http_version 1.1;
proxy_set_header Host $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_buffering on;
proxy_buffers 8 16k;
proxy_buffer_size 16k;
proxy_connect_timeout 5s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
}
}
}