码迷,mamicode.com
首页 > 其他好文 > 详细

nginx配置文件介绍

时间:2018-06-06 18:23:05      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:nginx配置

nginx.conf配置文件

include main.conf;x
http {
    include                                 control.conf;
    # include                    /alidata1/app/aegis_waf_ii/conf/waf.conf;
    server_tag                              off;
    server_info                             off;
    server_tokens                           off;
    include                                 vhost/*.outer;
}

main.conf配置文件

user                nginx;     #进程的工作用户
worker_processes    4;  #工作进程数 一般设置为CPU个数
error_log           /alidata1/logs/nginx/error.log;   #错误日志存放
events {
    use epoll;  #指定nginx的工作模型  [请见](http://blog.51cto.com/gavin0/2125645)
    worker_connections  20480;  #指定单个进程相应的最大连接数  nginx服务器相应的最大连接数为  worker_processes * worker_connections
}

www.outer配置文件

upstream dm-m.lianbooline.com {
    server 127.0.0.1:9080;
}

upstream www {
    server 127.0.0.1:8080;
}

upstream mobile {
    server 127.0.0.1:9080;
}

server {
    listen                              80;
    server_name                         t.lianbo.com;
    include                             vhost/t.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         pc.lianbo.com;
    include                             vhost/pc.lianbo.com.inner;
}

server {
    listen                              443;
    server_name                         pc.lianbo.com;
    include                             vhost/https.pc.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         www.lianbo.com;
    include                             vhost/www.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         m.lianbo.com;
    include                             vhost/m.lianbo.com.inner;
}

server {
    listen                              443 ssl http2 spdy;
    server_name                         m.lianbo.com;
    include                             vhost/https.m.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         10.156.245.63;
    include                             vhost/10.156.245.63.inner;
}

server {
    listen                              80;
    server_name                         xin.lianbo.com;
    include                             vhost/xin.lianbo.com.inner;
}

server {
    listen                              443 ssl http2 spdy;
    server_name                         www.lianbo.com;
    include                             vhost/https.www.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         lianbo.com;
    include                             vhost/lianbo.com.inner;
}

server {
    listen                              443 ssl http2 spdy;
    server_name                         lianbo.com;
    include                             vhost/https.lianbo.com.inner;
}

server {
        listen                              80;
        server_name                         a.lianbo.com;
        rewrite ^/(.*)$                     https://$host/$1 permanent;
}
server {
        listen                              443 ssl http2 spdy;
        server_name                         a.lianbo.com;
        include                             vhost/https.a.lianbo.com.inner;
}
server {
        listen                              80;
        server_name                         wx.lianbo.com;
        rewrite ^/(.*)$                     https://$host/$1 permanent;
}
server {
        listen                              443 ssl http2 spdy;
        server_name                         wx.lianbo.com;
        include                             vhost/https.wx.lianbo.com.inner;
}

server {
    listen                              80;
    server_name                         dm-m.lianbooline.com;
    rewrite (.*)$                       https://$host$1 permanent;
    #include                            vhost/dm-m.lianbooline.com.inner;
}

server {
    listen                              443;
    server_name                         dm-m.lianbooline.com;
    include                             vhost/https.dm-m.lianbooline.com.inner;
}

}

nginx配置文件介绍

标签:nginx配置

原文地址:http://blog.51cto.com/gavin0/2125646

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!