Nginx basic domain name port IP virtual host

Based on the domain name

##nginx number of concurrent connections processes multiplied by connection
## worker_processes number of service processes, generally the same as the cpu core
worker_processes 1;
events {
##Number of simultaneous services for one worker
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
### Add the following server block to prohibit IP access
server {
listen 80 default;
server_name _;
return 403;
}

server {
listen 80;
server_name www.etiantian.org;
location / {
root html /www;
index index.html index.htm;
}
}
server {
listen 80;
server_name bbs.etiantian.org;< br /> location / {
root html/bbs;
index index.html index.htm;
}
}
server {
listen 80;
server_name blog.etiantian.org;
location / {
root html/blog;
index index.html index.htm;
}
}
}

Leave a Comment

Your email address will not be published.