I cannot run Nginx because port 80 is already listening on a docker-proxy service.
tcp6 0 0 :::80 :::* LISTEN 13110/docker-proxy
I would like to run Nginx on port 8800 instead of the default port 80.
As such, I've edited the default file as below;
sudo nano /etc/nginx/sites-available/default
listen 8800 default_server;
listen [::]:8800 default_server;
listen localhost;
However, I still cannot get it working as expected even after restart.
What am I doing wrong and how can I resolve it?
Below is the error I get;
● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-04-26 04:23:14 EDT; 13min ago
Docs: man:nginx(8)
Process: 16955 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 16944 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 80941 (code=exited, status=0/SUCCESS)
Apr 26 04:23:11 ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 26 04:23:11 ubuntu nginx[16955]: nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use) Apr 26 04:23:12 ubuntu nginx[16955]: nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
Apr 26 04:23:12 ubuntu nginx[16955]: nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
Apr 26 04:23:13 ubuntu nginx[16955]: nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
Apr 26 04:23:13 ubuntu nginx[16955]: nginx: [emerg] bind() to 127.0.0.1:80 failed (98: Address already in use)
Apr 26 04:23:14 ubuntu nginx[16955]: nginx: [emerg] still could not bind()
Apr 26 04:23:14 ubuntu systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 26 04:23:14 ubuntu systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 26 04:23:14 ubuntu systemd[1]: Failed to start A high performance web server and a reverse proxy server.