Redstone 云观象台 服务器部署 - Nginx配置文件

以下信息仅针对Redstone的Ngxin配置文件进行更新。

web服务器Nginx配置文件结构如下:

/etc/nginx/nginx.conf

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
#worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

#自定义设置
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

events {
    use epoll;
    worker_connections 2056;
}

http {
    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        #include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

----

/etc/nginx/conf.d/cloud_ota.conf(云观象台配置文件)

server {
    listen       8010;
    listen       8610;
    server_name  fota.redstone.net.cn;

    set $path "/home/www/cloud_ota";

    #加载默认配置
    include /etc/nginx/default.d/*.conf;
}

----

/etc/nginx/conf.d/bigdata.conf(大数据配置文件)

server {
    listen       8020;
    listen       8620;
    server_name  bigdata.redstone.net.cn;

    set $path "/home/www/bigdata";

    #加载默认配置
    include /etc/nginx/default.d/*.conf;
}

----

/etc/nginx/conf.d/konka.conf(康佳配置文件)

client_max_body_size 2000m;
server {
    listen       80;
    listen       8030;
    server_name  konka.ota.redstone.net.cn;

    set $path "/home/www/rs_detection";

    #加载默认配置
    include /etc/nginx/default.d/*.conf;
}

----

/etc/nginx/default.d/default.conf

location / {
    root   $path;
    index  index.html index.htm index.php; 

    #client_max_body_size 30m;

    if (!-e $request_filename)
    {
        rewrite ^/(.*)$ /index.php/$1 last;
        break;
    }

}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#location ~ \.php$ {
location ~ .*\.(php|php5)/?.*$ {
    root           $path;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;

    client_max_body_size 1024m;

    #定义变量 $path_info ,用于存放pathinfo信息
    set $path_info "";
    #定义变量 $real_script_name,用于存放真实地址
    set $real_script_name $fastcgi_script_name;
    #如果地址与引号内的正则表达式匹配
    if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
            #将文件地址赋值给变量 $real_script_name
            set $real_script_name $1;
            #将文件地址后的参数赋值给变量 $path_info
            set $path_info $2;
    }
    fastcgi_param SCRIPT_NAME $real_script_name;
    fastcgi_param PATH_INFO $path_info;

    #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

# deny access to .htaccess files, if Apache‘s document root
# concurs with nginx‘s one
#
#location ~ /\.ht {
#    deny  all;
#}

#禁止浏览器下载有此后缀名的文件
location ~* \.(ini|txt|log)$ {
     deny all;
}

-------------------------------------------------------------------------

反向代理服务器Nginx配置文件结构如下:

/etc/nginx/nginx.conf

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        rewrite ^(.*) http://www.redstone.net.cn ;#permanent
    }
}

----  

/etc/nginx/conf.d/cloud_ota.conf(云观象台配置文件)

upstream servers_cloud_ota   {
     server 114.215.180.137:8010;
     server 114.215.178.111:8010 backup;
}
upstream servers_cloud_ota_api   {
     server 114.215.180.137:8610;
     server 114.215.178.111:8610 backup;
}

server {
    listen       80;
    server_name  fota.redstone.net.cn;

    location / {

        proxy_set_header Host $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
	proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
        proxy_pass  http://servers_cloud_ota;

    }
}

server {
    listen       6100;
    server_name  fota.redstone.net.cn;

    location / {

        proxy_set_header Host $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
	proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
        proxy_pass  http://servers_cloud_ota_api;

    }

}

----

/etc/nginx/conf.d/bigdata.conf(大数据配置文件)

upstream servers_bigdata   {
     server 114.215.180.137:8020;
     server 114.215.178.111:8020 backup;
}
upstream servers_bigdata_api   {
     server 114.215.180.137:8620;
     server 114.215.178.111:8620 backup;
}

server {
    listen       80;
    server_name  bigdata.redstone.net.cn;

    location / {

        proxy_set_header Host $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass  http://servers_bigdata;

    }
}

server {
    listen       6100;
    server_name  bigdata.redstone.net.cn;

    location / {

        proxy_set_header Host $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass  http://servers_bigdata_api;

    }

}

----

/etc/nginx/conf.d/konka.conf(康佳配置文件)

upstream servers_konka   {
     server 114.215.180.137:8030;
     server 114.215.178.111:8030 backup;
}

server {
    listen       80;
    server_name  konka.ota.redstone.net.cn;

    location / {

        proxy_set_header Host $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass  http://servers_konka;

    }
}
时间: 2024-12-06 07:21:33

Redstone 云观象台 服务器部署 - Nginx配置文件的相关文章

阿里云ECS服务器部署django

参考 服务器安装的是Centos 系统. uwsgi是使用pip安装的. nginx是使用yum install nginx安装. python 2.7, mysql 5.5使用 yum安装. 它们之间的逻辑关系如下: the web client <-> the web server <-> the socket <-> uwsgi <-> Django uswgi负责从Django拿内容,通过socket传给 web server如nginx, 最后显示

阿里云ECS服务器部署HADOOP集群(五):Pig 安装

本篇将在阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建的基础上搭建. 1 环境介绍 一台阿里云ECS服务器:master 操作系统:CentOS 7.3 Hadoop:hadoop-2.7.3.tar.gz Java: jdk-8u77-linux-x64.tar.gz Pig: pig-0.17.0.tar.gz 2 Pig 下载 下载 pig-0.17.0.tar.gz 并在合适的位置解压缩,笔者这里解压缩的路径为: /usr/local 将解压得到的目录改

阿里云ECS服务器部署HADOOP集群(四):Hive本地模式的安装

本篇将在阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建的基础上搭建. 本地模式需要采用MySQL数据库存储数据. 1 环境介绍 一台阿里云ECS服务器:master 操作系统:CentOS 7.3 Hadoop:hadoop-2.7.3.tar.gz Java: jdk-8u77-linux-x64.tar.gz Hive:apache-hive-2.3.6-bin.tar.gz Mysql: Mysql 5.7 MySQL Connector-J:mysql-

阿里云ECS服务器部署HADOOP集群(七):Sqoop 安装

本篇将在 阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建 阿里云ECS服务器部署HADOOP集群(二):HBase完全分布式集群搭建(使用外置ZooKeeper) 阿里云ECS服务器部署HADOOP集群(三):ZooKeeper 完全分布式集群搭建 阿里云ECS服务器部署HADOOP集群(四):Hive本地模式的安装 的基础上搭建. 1 环境介绍 一台阿里云ECS服务器:master 操作系统:CentOS 7.3 Hadoop:hadoop-2.7.3.tar

阿里云ECS服务器部署HADOOP集群(六):Flume 安装

本篇将在阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建的基础上搭建. 1 环境介绍 一台阿里云ECS服务器:master 操作系统:CentOS 7.3 Hadoop:hadoop-2.7.3.tar.gz Java: jdk-8u77-linux-x64.tar.gz Flume:apache-flume-1.8.0-bin.tar.gz 2 Flume 下载 下载 apache-flume-1.8.0-bin.tar.gz 并在合适的位置解压缩,笔者这里解压

阿里云ECS服务器部署HADOOP集群(三):ZooKeeper 完全分布式集群搭建

本篇将在阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建的基础上搭建,多添加了一个 datanode 节点 . 1 节点环境介绍: 1.1 环境介绍: 服务器:三台阿里云ECS服务器:master, slave1, slave2 操作系统:CentOS 7.3 Hadoop:hadoop-2.7.3.tar.gz Java: jdk-8u77-linux-x64.tar.gz ZooKeeper: zookeeper-3.4.14.tar.gz 1.2 各节点角色

记录一次在阿里云ECS服务器部署验证RocketMQ的经历

==背景== 购买了3台阿里云ECS服务器,上面部署了RocketMQ,用来作为业务后台与平台之间的数据通讯中间件. 部署倒是异常顺利,不过在本地写程序,测试生产和消费数据的时候,出现了一些问题. 耗费了将近1天的时间,终于解决了,记录一下本次排查的经历. ==环境== Linux:CentOS8(阿里云ECS服务器) RocketMQ:4.6.1 ==集群== 节点数:3个 节点1:broker-a(master) 节点2:broker-a(slave),broker-b(master) 节点

阿里云配置服务器部署项目

最近双11来了,作为程序员,终于买了个阿里云ecs服务器,主要便宜. 对于一个前端开发人来说服务器,项目部署好像搭不上边,但是对于爱好者,可以了解一下.刚刚买完不知道怎么搭建.官方给的解释太繁琐,不知道有没有小伙伴跟我一样的感受. 好了话不多说,直接开挂,看截图. 1.这是刚刚购买的状态. 2.这部很关键 要不直接失败.找到安全规则,其他默认的不要改,直接点击右上方,添加安全组规则,填写一个协议,端口范围为了保守填写一个80,授权对象0.0.0.0/0就好.点击保存.这一步配置完成. 3.然后去

阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建

准备: 两台配置CentOS 7.3的阿里云ECS服务器: hadoop-2.7.3.tar.gz安装包: jdk-8u77-linux-x64.tar.gz安装包: hostname及IP的配置: 更改主机名: 由于系统为CentOS 7,可以直接使用‘hostnamectl set-hostname 主机名’来修改,修改完毕后重新shell登录或者重启服务器即可. 1 hostnamectl set-hostname master 2 exit 3 ssh [email protected]