forked from dveselov/docsbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
52 lines (39 loc) · 1.58 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
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
server {
listen 80;
# Define allowed methods for 405 response
error_page 405 @error405;
location @error405 {
add_header Allow "GET, POST, DELETE, OPTIONS" always;
}
# Restrict other methods
if ($request_method !~ ^(GET|POST|DELETE|OPTIONS)$) {
return 405;
}
charset utf-8;
location / {
proxy_pass http://web:8000;
proxy_http_version 1.1;
proxy_buffering off;
proxy_next_upstream off;
proxy_force_ranges on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Content-Disposition';
add_header 'Access-Control-Expose-Headers' 'Content-Disposition';
# Allow body size to up to 100M
client_max_body_size 100M;
client_body_buffer_size 100M;
}
}
}