-
504 Gateway Timeout
upstream timed out (110: Connection timed out) while reading response header from upstream
Means NGINX timed out reading the HTTP response header from upstream. This
#!/bin/bash | |
# You need to uncomment two lines for the script work. | |
# Please check the logic before use it. | |
main () { | |
#aws s3 ls $BUCKETNAME | grep -v ' PRE ' | grep -v ' 0 ' > data.txt | |
UNIXDAYS=$(date -d "$DAYS days ago" +%s) | |
while read LINE | |
do |
Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.
To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:
$ sudo apt install libnginx-mod-http-geoip geoip-database
Old EBS volumes example:
growpart /dev/xvda 1
resize2fs /dev/xvda1
New NVME volumes example:
growpart /dev/nvme0n1 1
resize2fs /dev/nvme0n1p1
$i++;
$cfg['Servers'][$i]['verbose'] = 'Database Server 2';
$cfg['Servers'][$i]['host'] = '192.168.1.102';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
log_format postdata '$time_local $request $request_body'; | |
location = /path { | |
access_log /var/log/nginx/postdata.log postdata; | |
proxy_pass http://localhost:8080; # <= set your port | |
} |