Skip to content

Commit

Permalink
Merge pull request #32 from skalenetwork/hotfix/improve-nginx
Browse files Browse the repository at this point in the history
Hotfix/improve nginx configuration
  • Loading branch information
dmytrotkk authored Nov 17, 2022
2 parents bf5e81f + f09e108 commit e60e074
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
13 changes: 12 additions & 1 deletion config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ events {
worker_connections 100000;
}

worker_processes auto;

http {
log_format upstreamlog '[$time_local] $request $status $host - $remote_addr to: $upstream_addr - urt: $upstream_response_time msec: $msec req_t: $request_time ($http_referer $http_user_agent)';
access_log /var/log/nginx/access.log upstreamlog;

limit_req_zone $binary_remote_addr zone=one:10m rate=100r/s;
client_max_body_size 5M;
Expand All @@ -22,7 +26,7 @@ http {

location / {
proxy_http_version 1.1;
proxy_pass http://network-ui:5001/;
proxy_pass http://localhost:5001/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
Expand All @@ -33,6 +37,13 @@ http {
root /usr/share/nginx/www;
}

location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}

include /etc/nginx/conf/chains/*.conf;
}

Expand Down
11 changes: 4 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ services:
network-ui:
image: network-ui:latest
container_name: network_ui
network_mode: host
build:
context: ./network-ui
dockerfile: Dockerfile
ports:
- "5001:5001"
logging:
driver: "json-file"
options:
Expand Down Expand Up @@ -36,9 +35,7 @@ services:
nginx:
image: nginx:1.20.2
container_name: proxy_nginx
ports:
- "80:80"
- "443:443"
network_mode: host
volumes:
- ./data:/data
- ./www:/usr/share/nginx/www/files
Expand All @@ -47,5 +44,5 @@ services:
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "200m"
max-file: "200"
max-size: "500m"

0 comments on commit e60e074

Please sign in to comment.