2👍
What I see in your netstat
output is that nginx is already running on your system. On systems like Debian or Ubuntu, and probably other *nix systems, when you install nginx it is installed so that it starts when the system boots. Then when you try to run it from the command line you are running a second instance that tries to use the same port as the instance that starts at boot time. On Debian or Ubuntu systems you can stop nginx from starting by doing:
$ sudo service nginx stop
$ sudo rm /etc/nginx/sites-enabled/default
Removing the default prevents it from starting again. That default file is a symlink to /etc/nginx/sites-available/default
so you can easily recreate it if needed.
Or if you want to keep the nginx that starts at boot running on its port, you could use a configuration for your nginx started from the command line that uses a different port, for instance:
server {
listen 3333 default_server;
listen [::]:3333 default_server ipv6only=on;
Additional note: If you put your site in /etc/nginx/sites-enabled/
then you must not start your instance of nginx from the command line. You should control nginx only through sudo service nginx [...]
.