首先配置nginx.conf

[root@localhost conf]# cat nginx.conf
worker_processes 1;
user nginx nginx;
error_log /app/log/nginx.error.log;

events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
include extra/nginx.vhosts.conf; #包含文件
log_format main '$remote_addr - $remote_user [$time_local] "$request" ';
error_page 500 502 503 504 /50x.html;
}

 vim /workspace/nginx/conf/extra/nginx.host.conf

#只写server
server {
listen 80;
server_name localhost;
location / {
index index.jsp index.htm index.html;
root /data0/www/www;
access_log /app/log/www.access.log;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
###
server {
listen 100;
server_name localhost;
location / {
index index.jsp index.htm index.html;
root /data0/www/bbs;
access_log /app/log/www.access.log;
}
}

###
server {
listen 200;
server_name localhost;
location / {
index index.jsp index.htm index.html;
root /data0/www/blog;
access_log /app/log/www.access.log;
}
}

相关文章:

  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-05-02
  • 2022-01-02
  • 2022-01-26
猜你喜欢
  • 2021-11-21
  • 2021-09-18
  • 2022-01-12
  • 2021-10-18
  • 2021-12-03
  • 2021-08-17
  • 2022-12-23
相关资源
相似解决方案