Nginx是一款轻量级的Web服务器、反向代理服务器,由于它的内存占用少,启动极快,高并发能力强,在互联网项目中广泛应用。该软件由Igor Sysoev创建,并于2004年首次公开发布。同名公司成立于2011年,以提供支持。Nginx是一款免费的开源软件,根据类BSD许可证的条款发布。一大部分Web服务器使用Nginx,通常作为负载均衡器。
apt-get安装bashsudo apt-get update sudo apt-get install nginx
nginx状态bashsudo systemctl status nginx ps -ef |grep nginx
jsonserver {
server_name 域名;
client_max_body_size 1024m;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
}
location ~ ^/(ws|terminal/.+)$ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
}
}
nginx相关进程bashps -ef |grep nginx
sudo kill -9 进程号
nginx –purge配置文件bashsudo apt-get --purge remove nginx
bashsudo apt-get autoremove
nginx相关的软件bashdpkg --get-selections|grep nginx
执行结果:
bashnginx install nginx-common install nginx-core install
nginx有关的内容bashsudo apt-get --purge remove nginx sudo apt-get --purge remove nginx-common sudo apt-get --purge remove nginx-core
nginx相关的文件,并删除bashsudo find / -name nginx*
sudo rm -rf 文件名
About Nginx