nginx服务器简单搭建配置
来源:互联网 发布:上海黄金行情软件 编辑:程序博客网 时间:2024/04/27 23:14
下载nginx
http://nginx.org/en/download.html
安装nginx
安装依赖的程序
gzip
pcre下载地址http://sourceforge.net/projects/pcre/files/pcre/
openssl
安装命令
tar -zxvf nginx-1.0.10.tar.gz
cd nginx-1.0.10
./configure
make;make install
nginx还有更多的选项可在安装时进行配置
配置nginx
配置文件路径/usr/local/nginx/conf/nginx.conf
user nobody nobody;worker_processes 1;error_log logs/error.log;events { worker_connections 1024;}#设定http服务器,利用它的反向代理功能提供负载均衡支持http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #访问地址 upstream localhost { #设定负载均衡的服务器列表 server localhost:8080; server localhost:8081; } #设定虚拟主机,默认为监听80端口 server { listen 80; server_name localhost; charset utf-8; location / { proxy_pass http://localhost; } }}
启动nginx linux命令 /usr/local/nginx/sbin/nginx
nginx -s stop 快速关闭nginx,可能不保存相关信息,并迅速终止web服务。(quick exit)
nginx -s quit 平稳关闭nginx,保存相关信息,有安排的结束web服务。(graceful exit)
nginx -s reload 因改变了nginx相关配置,需要重新加载配置而重载。(changing configuration,start a new worker,quitting an old worker gracefully.)
nginx -s reopen 重新打开日志文件。(reopenging log files)
- nginx服务器简单搭建配置
- Linux服务器搭建及简单nginx配置
- nginx搭建简单图片服务器
- win7下搭建Nginx简单图片服务器
- 服务器搭建:CentOS上安装配置nginx
- [LNMPA搭建五]Nginx服务器详细【配置】
- Nginx服务器搭建和基本配置详解
- Linux上搭建nginx,及简单配置
- Linux上搭建nginx,及简单配置
- Linux上搭建nginx,及简单配置
- 简单的 nginx https 服务器配置
- Windows7下配置简单的nginx服务器
- nginx静态资源服务器简单配置
- nginx静态资源服务器简单配置
- Nginx静态资源服务器简单配置
- nginx静态资源服务器简单配置
- nginx动静资源服务器简单配置
- 简单的nginx服务器vhost配置
- Vim+cscope+ctags+tags阅读源代码
- Linux面试题
- 通信(Netty、Mina2)【通信粘包的处理】、【数据协议】、【网络系统的安全性】
- 获取checkbox选中的值的问题。。
- 记录
- nginx服务器简单搭建配置
- 每天学点MVC 【View传参】
- 网址收藏
- ContentObserver与DatasetObserver区别
- 汉诺塔 算法(递归和非递归算法)
- 沈园恋(写在前面)
- 查看當前數據庫索引情況
- PHP 函数库
- 如果后台的Activity由于某原因被系统回收了,如何在被系统回收之前保存当前状态?