chenshenhai / blog

个人博客,没事写写玩玩~~~
146 stars 21 forks source link

Linux下安装nginx #26

Open chenshenhai opened 6 years ago

chenshenhai commented 6 years ago

系统

CentOS

系统工具

yum -y install make gcc-c++ libtool   openssl openssl-devel  zlib zlib-devel 

安装pcre

安装nginx

配置nginx 全局变量

使用nginx

# 启动 nginx 服务
nginx 

# 关闭 nginx 服务
nginx -s stop

其他nginx配置

多域名共用 80 端口

server {
    listen  80;
    server_name     001.example.com;
    location / {
        proxy_pass      http://127.0.01:3001;
    }
}

server {
    listen  80;
    server_name     002.example.com;
    location / {
        proxy_pass      http://127.0.01:3002;
    }
}