apt install nginx
systemctl status nginx
systemctl restart nginx
systemctl reload nginx
ss -ltup
Após qualquer modificação no arquivo, restart o serviço nginx.
/etc/nginx/
worker_processes 1; #ou auto
worker_connections 1024; #quantidades de conexões
http{ #configurações de http
server{#local de configurações das conexões
listen 8080;#porta de conexão
server_name localhost;#colocar o nome do domínio
location /{ #configuração quando recebe requisição para apenas '/'
root html;
index index.html index.htm;
}
}
}
/etc/nginx/sites-enabled/
server{
listen 80 default_server;
listen [::}::80 default_server;
server_name domain.name.com;
location /{ #endereço de redirecionamento
proxy_pass http://127.0.0.1:10000;#indique aqui a porta que quer utilizar
proxy_set_header Host $host;#Não é necessário
}
}
HTTP 80 port já esta sendo usada:
sudo service apache2 stop sudo systemctl restart nginx