mempool: remove unneded nginx config files
mempool.conf, nginx.conf were not used in nix-bitcoin.
This commit is contained in:
parent
710a92d18c
commit
9a044fbfed
5 changed files with 3 additions and 129 deletions
|
|
@ -167,7 +167,7 @@ let
|
||||||
# This must be added to `services.nginx.commonHttpConfig` when
|
# This must be added to `services.nginx.commonHttpConfig` when
|
||||||
# `mempool/location-static.conf` is used
|
# `mempool/location-static.conf` is used
|
||||||
httpConfig = ''
|
httpConfig = ''
|
||||||
include ${nbPkgs.mempool-nginx-conf}/mempool/http-language.conf;
|
include ${nbPkgs.mempool-nginx-conf}/http-language.conf;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Config for static website content.
|
# Config for static website content.
|
||||||
|
|
@ -180,7 +180,7 @@ let
|
||||||
add_header Vary Accept-Language;
|
add_header Vary Accept-Language;
|
||||||
add_header Vary Cookie;
|
add_header Vary Cookie;
|
||||||
|
|
||||||
include ${nbPkgs.mempool-nginx-conf}/mempool/location-static.conf;
|
include ${nbPkgs.mempool-nginx-conf}/location-static.conf;
|
||||||
|
|
||||||
# Redirect /api to /docs/api
|
# Redirect /api to /docs/api
|
||||||
location = /api {
|
location = /api {
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ rec {
|
||||||
|
|
||||||
mempool-nginx-conf = runCommand "mempool-nginx-conf" {} ''
|
mempool-nginx-conf = runCommand "mempool-nginx-conf" {} ''
|
||||||
${sync} --chmod=u+w ${./nginx-conf}/ $out
|
${sync} --chmod=u+w ${./nginx-conf}/ $out
|
||||||
${sync} ${src}/production/nginx/http-language.conf $out/mempool
|
${sync} ${src}/production/nginx/http-language.conf $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
sync = "${rsync}/bin/rsync -a --inplace";
|
sync = "${rsync}/bin/rsync -a --inplace";
|
||||||
|
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
access_log /var/log/nginx/access_mempool.log;
|
|
||||||
error_log /var/log/nginx/error_mempool.log;
|
|
||||||
|
|
||||||
root /var/www/mempool/browser;
|
|
||||||
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
# enable browser and proxy caching
|
|
||||||
add_header Cache-Control "public, no-transform";
|
|
||||||
|
|
||||||
# vary cache if user changes language preference
|
|
||||||
add_header Vary Accept-Language;
|
|
||||||
add_header Vary Cookie;
|
|
||||||
|
|
||||||
include mempool/location-static.conf;
|
|
||||||
|
|
||||||
# static API docs
|
|
||||||
location = /api {
|
|
||||||
try_files $uri $uri/ /en-US/index.html =404;
|
|
||||||
}
|
|
||||||
location = /api/ {
|
|
||||||
try_files $uri $uri/ /en-US/index.html =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/v1/ws {
|
|
||||||
proxy_pass http://127.0.0.1:8999/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
}
|
|
||||||
location /api/v1 {
|
|
||||||
proxy_pass http://127.0.0.1:8999/api/v1;
|
|
||||||
}
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://127.0.0.1:8999/api/v1/;
|
|
||||||
}
|
|
||||||
|
|
||||||
# mainnet API
|
|
||||||
location /ws {
|
|
||||||
proxy_pass http://127.0.0.1:8999/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
}
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
user nobody;
|
|
||||||
pid /var/run/nginx.pid;
|
|
||||||
|
|
||||||
worker_processes auto;
|
|
||||||
worker_rlimit_nofile 100000;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 9000;
|
|
||||||
multi_accept on;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
|
|
||||||
server_tokens off;
|
|
||||||
server_name_in_redirect off;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log;
|
|
||||||
error_log /var/log/nginx/error.log;
|
|
||||||
|
|
||||||
# reset timed out connections freeing ram
|
|
||||||
reset_timedout_connection on;
|
|
||||||
# maximum time between packets the client can pause when sending nginx any data
|
|
||||||
client_body_timeout 10s;
|
|
||||||
# maximum time the client has to send the entire header to nginx
|
|
||||||
client_header_timeout 10s;
|
|
||||||
# timeout which a single keep-alive client connection will stay open
|
|
||||||
keepalive_timeout 69s;
|
|
||||||
# maximum time between packets nginx is allowed to pause when sending the client data
|
|
||||||
send_timeout 69s;
|
|
||||||
|
|
||||||
# number of requests per connection, does not affect SPDY
|
|
||||||
keepalive_requests 1337;
|
|
||||||
|
|
||||||
# enable gzip compression
|
|
||||||
gzip on;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_min_length 1000;
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
# text/html is always compressed by gzip module
|
|
||||||
gzip_types application/javascript application/json application/ld+json application/manifest+json application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard;
|
|
||||||
|
|
||||||
# limit request body size
|
|
||||||
client_max_body_size 10m;
|
|
||||||
|
|
||||||
# proxy cache
|
|
||||||
proxy_cache off;
|
|
||||||
proxy_cache_path /var/cache/nginx keys_zone=cache:20m levels=1:2 inactive=600s max_size=500m;
|
|
||||||
types_hash_max_size 2048;
|
|
||||||
|
|
||||||
# exempt localhost from rate limit
|
|
||||||
geo $limited_ip {
|
|
||||||
default 1;
|
|
||||||
127.0.0.1 0;
|
|
||||||
}
|
|
||||||
map $limited_ip $limited_ip_key {
|
|
||||||
1 $binary_remote_addr;
|
|
||||||
0 '';
|
|
||||||
}
|
|
||||||
|
|
||||||
# rate limit requests
|
|
||||||
limit_req_zone $limited_ip_key zone=api:5m rate=200r/m;
|
|
||||||
limit_req_zone $limited_ip_key zone=electrs:5m rate=2000r/m;
|
|
||||||
limit_req_status 429;
|
|
||||||
|
|
||||||
# rate limit connections
|
|
||||||
limit_conn_zone $limited_ip_key zone=websocket:10m;
|
|
||||||
limit_conn_status 429;
|
|
||||||
|
|
||||||
include mempool/http-language.conf;
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 127.0.0.1:80;
|
|
||||||
include mempool/mempool.conf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue