-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.example.conf
37 lines (30 loc) · 1.11 KB
/
nginx.example.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
# Merge this file with the nginx example from the MaCPepDB Python repo
# and add the `location / { ... }` as last location block.
# MaCPepDB Web GUI handler for GUI requests
upstream frontend_handler {
server frontend:3000;
}
server {
listen 8080;
server_name localhost;
# Adjust handling of client body
client_max_body_size 500M;
client_body_buffer_size 30M;
# Make files sending more efficient
sendfile on;
tcp_nopush on;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods *;
add_header Access-Control-Expose-Headers Content-Type;
# Deliver frontend
location / {
add_header Served-By "frontend"; # Only to check if the requests is served by the correct location block during testing
proxy_pass http://frontend_handler;
# Disable buffering of upstream responses.
proxy_buffering off;
# Set proxy headers for Flask
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}