安装
linux
- 从官网(http://nginx.org/en/download.html)下载nginx包
- 解压进到目录中
- 安装依赖
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
./configure --prefix=${安装路径}
make & make install
配置文件
http {
# 连接超时时间
keepalive_timeout 86400;
proxy_read_timeout 86400;
# 请求最大限制
client_max_body_size 1000000m;
server {
listen 80;
server_name localhost;
location /${url} {
proxy_pass ${转发地址};
proxy_set_header Host $host;
}
}
}
重启
./nginx -s reload
检查配置文件
./nginx -t