nginx 502 Bad Gateway

1.0 502 Bad Gateway

nginx 502 Bad Gateway

After the update of Linux on the web server, the website would not open in the browser. Instead the following error was displayed.

502 Bad Gateway
nginx/1.14.0

2.0 Solution

First we check the nginx server.

$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-03-21 15:16:47 UTC; 16h ago
     Docs: man:nginx(8)
 Main PID: 1354 (nginx)
    Tasks: 8 (limit: 1158)
   CGroup: /system.slice/nginx.service
           ├─1354 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─1355 nginx: worker process

Warning: Journal has been rotated since unit was started.
Read more

MCE hardware error cpu 0

1.0 Error

Error

While running Ubuntu 18.04.1 on a laptop, the following errors were observed.

mce: hardware error cpu 0 machine check 0 bank 6 ae0000000040110a
mce: hardware error tsc 0 addr ffb07540 misc 238a0000086
mce: hardware error processor 0:40651 time 1540082330 socket 0 Apic 0 microcode 24
ipmi dmi invalid offset 0

The system would stop in the single user mode.… Read more

Failed to fetch webpage, temporary failure resolving domain

1.0 Error

While configuring a Linux server, the error Failed to fetch webpage, temporary failure resolving domain was observed.

$ sudo apt-get update
Err:1 http://mirrors.xxxxxx.com/ubuntu bionic InRelease
  Temporary failure resolving 'mirrors.xxxxxx.com'
Err:2 http://mirrors.xxxxxx.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'mirrors.xxxxxx.com'
Err:3 http://mirrors.xxxxxx.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'mirrors.xxxxxx.com'
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Reading package lists...
Read more

Error while executing the dig command

1.0 Error

While executing the dig command, the sendmsg() failed: Operation not permitted error was printed.

$ dig example.com
../../../../lib/isc/unix/net.c:581: sendmsg() failed: Operation not permitted
../../../../lib/isc/unix/net.c:581: sendmsg() failed: Operation not permitted
...

2.0 Solution

The error was resolved after adding the following iptables rules.… Read more