状态检测
####工作的子进程数量(通常等于CPU数量或者2倍于CPU)
worker_processes 1;
####工作模式及连接数上限
events {
worker_connections 1024;
}
####设置http服务器
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
####虚拟主机的配置
server {
####监听端口
listen 80;
####域名可以有多个,用空格隔开
server_name localhost;
location / {
proxy_pass http://192.168.12.70:18099;
}
location ~ /status {
stub_status on;
access_log off;
}
}
}
多虚拟主机
####工作的子进程数量(通常等于CPU数量或者2倍于CPU)
worker_processes 1;
####工作模式及连接数上限
events {
worker_connections 1024;
}
####设置http服务器
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#虚拟主机
server {
listen 8081;
server_name localhost;
charset utf-8;
# access_log logs/aa.access.log info;
location / {
root html/aa;
index index.html index.htm;
}
}
server{
listen 8082;
server_name localhost;
charset utf-8;
# access_log logs/bb.access.log info;
location / {
root html/bb;
index index.html;
}
}
}
####工作的子进程数量(通常等于CPU数量或者2倍于CPU)
worker_processes 1;
####工作模式及连接数上限
events {
worker_connections 1024;
}
####设置http服务器
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
####虚拟主机的配置
server {
####监听端口
listen 80;
####域名可以有多个,用空格隔开
server_name localhost;
location / {
proxy_pass http://192.168.12.70:18099;
}
location ~ /status {
stub_status on;
access_log off;
}
}
}
多虚拟主机
####工作的子进程数量(通常等于CPU数量或者2倍于CPU)
worker_processes 1;
####工作模式及连接数上限
events {
worker_connections 1024;
}
####设置http服务器
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#虚拟主机
server {
listen 8081;
server_name localhost;
charset utf-8;
# access_log logs/aa.access.log info;
location / {
root html/aa;
index index.html index.htm;
}
}
server{
listen 8082;
server_name localhost;
charset utf-8;
# access_log logs/bb.access.log info;
location / {
root html/bb;
index index.html;
}
}
}