mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Addressing comments
This commit is contained in:
parent
4371a2ce4b
commit
dbddc7c85c
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
docker build -t bigchaindb/nginx_http:1.0 .
|
docker build -t bigchaindb/nginx_http:1.1 .
|
||||||
|
|
||||||
docker push bigchaindb/nginx_http:1.0
|
docker push bigchaindb/nginx_http:1.1
|
||||||
|
@ -80,10 +80,6 @@ http {
|
|||||||
# max client request body size: avg transaction size.
|
# max client request body size: avg transaction size.
|
||||||
client_max_body_size 15k;
|
client_max_body_size 15k;
|
||||||
|
|
||||||
if ($request_method !~ ^(GET|OPTIONS|POST)$) {
|
|
||||||
return 444;
|
|
||||||
}
|
|
||||||
|
|
||||||
# No auth for GETs, forward directly to BDB.
|
# No auth for GETs, forward directly to BDB.
|
||||||
if ($request_method = GET) {
|
if ($request_method = GET) {
|
||||||
proxy_pass http://$bdb_backend:BIGCHAINDB_API_PORT;
|
proxy_pass http://$bdb_backend:BIGCHAINDB_API_PORT;
|
||||||
@ -91,6 +87,7 @@ http {
|
|||||||
|
|
||||||
# POST requests get forwarded to OpenResty instance. Enable CORS too.
|
# POST requests get forwarded to OpenResty instance. Enable CORS too.
|
||||||
if ($request_method = POST ) {
|
if ($request_method = POST ) {
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
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-Range,Range';
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||||
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||||
@ -108,6 +105,11 @@ http {
|
|||||||
add_header 'Content-Length' 0;
|
add_header 'Content-Length' 0;
|
||||||
return 204;
|
return 204;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Only return this reponse if request_method is neither POST|GET|OPTIONS
|
||||||
|
if ($request_method !~ ^(GET|OPTIONS|POST)$) {
|
||||||
|
return 444;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,10 +97,6 @@ http {
|
|||||||
# max client request body size: avg transaction size.
|
# max client request body size: avg transaction size.
|
||||||
client_max_body_size 15k;
|
client_max_body_size 15k;
|
||||||
|
|
||||||
if ($request_method !~ ^(GET|OPTIONS|POST)$) {
|
|
||||||
return 444;
|
|
||||||
}
|
|
||||||
|
|
||||||
# No auth for GETs, forward directly to BDB.
|
# No auth for GETs, forward directly to BDB.
|
||||||
if ($request_method = GET) {
|
if ($request_method = GET) {
|
||||||
proxy_pass http://$bdb_backend:BIGCHAINDB_API_PORT;
|
proxy_pass http://$bdb_backend:BIGCHAINDB_API_PORT;
|
||||||
@ -126,6 +122,11 @@ http {
|
|||||||
add_header 'Content-Length' 0;
|
add_header 'Content-Length' 0;
|
||||||
return 204;
|
return 204;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Only return this reponse if request_method is neither POST|GET|OPTIONS
|
||||||
|
if ($request_method !~ ^(GET|OPTIONS|POST)$) {
|
||||||
|
return 444;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +148,7 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
add_header Upgrade "TLS/1.2, HTTP/1.1" always;
|
add_header Upgrade "TLS/1.2, HTTP/1.1" always;
|
||||||
default_type text/plain;
|
default_type text/plain;
|
||||||
return 301 'Consider using the HTTPS protocol next time!';
|
return 426 'Consider using the HTTPS protocol next time!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user