• nginx 虚拟主机基于端口的搭建


    首先配置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;
    }
    }

  • 相关阅读:
    C 语言的读取文件
    [Water]序号呼唤
    [Water]Hdu 1022 Train Problem I
    [Water]Hdu 2054 A == B ?
    Java竞赛可能会用到的东西
    [Huffman]Hdu 2527 Safe Or Unsafe
    [Prim]Poj 1258 Agri-Net
    Hdu 1257 最少拦截系统 (LIS、贪心)
    [Max Sum]hdu 1003
    Hdu 2566 统计硬币
  • 原文地址:https://www.cnblogs.com/renliping/p/6253269.html
Copyright © 2020-2023  润新知