下载
wget https://tengine.taobao.org/download/tengine-2.3.3.tar.gz
安装依赖
yum -y install openssl openssl-devel yum -y install pcre pcre-devel
安装
tar xf tengine-1.2.3 cd tengine-1.2.3 ./configure make && make install
默认安装位置
# cd /usr/local/nginx/
查看模块
# sbin/nginx -m
测试配置文件
# sbin/nginx -t编译安装过程中,已经看到安装了fastcgi、uwsgi模块。 /usr/local/nginx/是默认安装路径,其子目录
- html默认部署目录
- sbin下面是nginx运行文件
- conf配置目录
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location ^~ /api/v1/ { rewrite ^/api/v1(/.*) $1 break; proxy_pass http://127.0.0.1:8000; } location / { root html; index index.html index.htm; } }^~ /api/v1/ 左前缀匹配 rewrite ^/api/v1(/.*) $1 break; 重写请求的path
# pwd /usr/local/nginx # sbin/nginx -t # sbin/nginx -s reload访问 http://192.168.142.130/ ,可以看到登录页了。 标签:sbin,v1,部署,nginx,api,tengine,安装 From: https://www.cnblogs.com/soymilk2019/p/17086323.html