ccf 3 vuotta sitten
vanhempi
commit
3386c08869
4 muutettua tiedostoa jossa 233 lisäystä ja 619 poistoa
  1. 232 0
      command/dev.php
  2. 1 1
      shell/container-up.sh
  3. 0 52
      yml/dev.yml
  4. 0 566
      yml/nginx.conf

+ 232 - 0
command/dev.php

@@ -0,0 +1,232 @@
+<?php
+namespace Proginn;
+
+use Exception;
+use Medoo\Medoo;
+use Proginn\Config;
+use Redis;
+
+class Start
+{
+    const IP_LOCK_KEY = 'docker:ip:';
+    /**
+     * 数据库链接
+     *
+     * @var Medoo $connection
+     *
+     */
+    protected static $connection;
+    /**
+     * 数据库链接
+     *
+     * @var Redis $redis
+     *
+     */
+    protected static $redis;
+    protected $startIP = 180936414; // 10.200.222.222
+    protected $domainSuffix = '.test.proginn.com';
+    protected $containersBasePath = '/workspace/project/';
+
+    public function __construct($argv)
+    {
+        // 防止git仓库有人改了文件权限,容器里面shell脚本无法执行
+        system("sudo chmod +x " . ROOT_DIR . '/shell/*');
+        $params = $this->parseArgs($argv);
+        $action = $params['action'];
+        $name = $params['name'];
+
+        switch ($action) {
+            case 'start':
+                $this->start($name);
+                break;
+            default:
+                echo "Usage: php index.php --action=start|remove --name=mydev --proginn-branch=dev --rooter-branch=dev --proginn-frontend-branch dev\n";
+                break;
+        }
+    }
+
+    public function start($name)
+    {
+        if (preg_match('/[^a-zA-Z0-9_]+/', $name)) {
+            echo "创建失败,容器名:{$name}只能字母、数字及下划线组成。\n";
+            return;
+        }
+
+        $db = $this->getConnection();
+        $row = $db->get('sites', '*', [
+            'name' => $name,
+        ]);
+        if (!empty($row)) {
+            echo "创建失败,容器:{$name}已经存在,请确认。\n";
+            return;
+        }
+        $ip = $this->getIp();
+        $ipv4 = long2ip($ip);
+        $domain = $name;
+        $fullDomain = $name . $this->domainSuffix;
+        $this->getConnection()->query('start transaction');
+        try {
+            $id = $this->getConnection()->insert('sites', [
+                'proginn_branch' => "dev",
+                'domain' => $domain,
+                'ip' => $ip,
+                'ipv4' => $ipv4,
+                'created_at' => time(),
+                'name' => $name,
+                'rooter_branch' => "dev",
+                'proginn_frontend_branch' => "dev",
+                'full_domain' => $fullDomain,
+            ]);
+            if (!$id) {
+                throw new Exception('创建数据库记录失败');
+            }
+            // 容器存储目录
+            $directory = $this->containersBasePath . $name;
+
+            // 创建日志相关目录
+            mkdir($directory . '/log/pm2', 0777, true); //
+            mkdir($directory . '/log/proginn_cache', 0777, true); //
+            // 配置存放目录
+            mkdir($directory . '/config', 0777, true); //
+            // yml 文件
+            $template = file_get_contents(ROOT_DIR . '/dockerfile/template.yml');
+            $template = str_replace('<containerName>', $name, $template);
+            $template = str_replace('<ip>', $ipv4, $template);
+            $template = str_replace('<proginn-branch>', "dev", $template);
+            $template = str_replace('<rooter-branch>', "dev", $template);
+            $template = str_replace('<proginn-frontend-branch>', "dev", $template);
+            $template = str_replace('<domain>', $domain, $template);
+            $template = str_replace('<fullDomain>', $fullDomain, $template);
+            file_put_contents($directory . '/config/docker.yml', $template);
+            // nginx 配置
+            $proxy = file_get_contents(ROOT_DIR . '/config/nginx/template/proxy.nginx.conf');
+            $proxy = str_replace('{{domain}}', $domain, $proxy);
+            $proxy = str_replace('{{ip}}', $ipv4, $proxy);
+            file_put_contents("/workspace/commonContainers/nginx/conf.d/{$name}.conf", $proxy);
+
+            $proginn = file_get_contents(ROOT_DIR . '/config/nginx/template/proginn.nginx.conf');
+            $proginn = str_replace('{{domain}}', $domain, $proginn);
+            $proginn = str_replace('{{ip}}', $ipv4, $proginn);
+            file_put_contents("{$directory}/config/nginx.conf", $proginn);
+
+            $log = file_get_contents(ROOT_DIR . '/config/logrotate/log.conf');
+            $log = str_replace('{{containerName}}', $name, $log);
+            file_put_contents($directory . '/config/logrotate.conf', $log);
+            system("sudo cp -f {$directory}/config/logrotate.conf /etc/logrotate.d/{$name}");
+            // 写入项目变量 Found orphan containers
+            file_put_contents($directory . '/config/.env', "COMPOSE_PROJECT_NAME={$name}");
+            // 启动容器
+            system("docker-compose -p {$name} -f {$directory}/config/docker.yml up -d");
+            // 重载Nginx
+            system("docker exec nginx nginx -s reload");
+            $this->getConnection()->query('commit');
+        } catch (\Throwable $e) {
+            echo "exception:" . $e->__toString() . "\n";
+            $this->getConnection()->query('rollback');
+            if (file_exists($directory . '/config/docker.yml')) {
+                system("docker-compose -p {$name} -f {$directory}/config/docker.yml rm -s -f");
+            }
+            $redis = $this->getRedis();
+            $lockKey = static::IP_LOCK_KEY . $ip;
+            $redis->del($lockKey);
+
+            // 容器存储目录
+            $directory = $this->containersBasePath . $name;
+            system("sudo rm -rf {$directory}");
+            system("rm -f /workspace/commonContainers/nginx/conf.d/{$name}.conf");
+            system("docker exec nginx nginx -s reload");
+            system("sudo rm -f /etc/logrotate.d/{$name}");
+        }
+    }
+    protected function remove($name)
+    {
+        $db = $this->getConnection();
+        $row = $db->get('sites', '*', [
+            'name' => $name,
+        ]);
+        if (empty($row)) {
+            echo "删除失败,容器:{$name}不存在,请确认。\n";
+            return;
+        }
+        $this->getConnection()->query('start transaction');
+        try {
+            // 容器存储目录
+            $directory = $this->containersBasePath . $name;
+            $db->delete('sites', [
+                'name' => $name,
+            ]);
+            if (file_exists($directory . '/config/docker.yml')) {
+                system("docker-compose -p {$name} -f {$directory}/config/docker.yml rm -s -f");
+            }
+            // 容器存储目录
+            $directory = $this->containersBasePath . $name;
+            system("sudo rm -rf {$directory}");
+            system("rm -f /workspace/commonContainers/nginx/conf.d/{$name}.conf");
+            system("docker exec nginx nginx -s reload");
+
+            $redis = $this->getRedis();
+            $lockKey = static::IP_LOCK_KEY . $row['ip'];
+            $redis->del($lockKey);
+
+            $this->getConnection()->query('commit');
+        } catch (\Throwable $e) {
+            echo "exception:" . $e->__toString() . "\n";
+            $this->getConnection()->query('rollback');
+        }
+    }
+    protected function getIp()
+    {
+        $ip = $this->startIP;
+        $redis = $this->getRedis();
+        while (true) {
+            $ip++;
+            $lockKey = static::IP_LOCK_KEY . $ip;
+            $lock = $redis->setnx($lockKey, $ip);
+            if ($lock) {
+                break;
+            }
+        }
+        return $ip;
+    }
+    protected function parseArgs($argv)
+    {
+        unset($argv[0]);
+        $params = [];
+        foreach ($argv as $i => $arg) {
+            $arg = explode('=', $arg);
+            $key = trim($arg[0], "-");
+            $val = $arg[1] ?? true;
+            $params[$key] = $val;
+        }
+        return $params;
+    }
+    protected function getRedis()
+    {
+        if (static::$redis === null) {
+            static::$redis = new Redis();
+            static::$redis->connect(Config::REDIS_HOST, Config::REDIS_PORT, 3);
+            static::$redis->auth(Config::REDIS_PASS);
+        }
+        return static::$redis;
+    }
+    /**
+     * @return Medoo
+     */
+    protected function getConnection()
+    {
+        if (static::$connection === null) {
+            static::$connection = new Medoo([
+                'database_type' => 'mysql',
+                'database_name' => Config::DB_NAME,
+                'server' => Config::DB_HOST,
+                'username' => Config::DB_USER,
+                'password' => Config::DB_PASS,
+                'charset' => Config::DB_CHAR,
+                'port' => Config::DB_PORT,
+                'prefix' => '',
+                'logging' => true,
+            ]);
+        }
+        return static::$connection;
+    }
+}

+ 1 - 1
shell/container-up.sh

@@ -13,7 +13,7 @@ fi
 
 # 同步nginx配置
 ln -f -s /data/docker/config/nginx/nginx.conf /etc/nginx/nginx.conf
-ln -f -s /data/docker/yml/nginx.conf /etc/nginx/conf.d/proginn.conf
+ln -f -s /data/config/nginx.conf /etc/nginx/conf.d/proginn.conf
 rm -f /etc/nginx/sites-enabled/default
 
 # 同步phpfpm配置

+ 0 - 52
yml/dev.yml

@@ -1,52 +0,0 @@
-version: "3.5"
-services:
-  dev:
-    image: registry.cn-beijing.aliyuncs.com/lscgzwd/ubuntu18.04-php7:latest
-    container_name: dev
-    restart: always
-    volumes:
-      - /workspace/projects/docker-test/:/data/docker
-      - /workspace/projects/proginn:/code:rw
-      - /workspace/projects/boss:/boss:rw
-      - /workspace/projects/proginn-user:/proginn-user:rw
-      - /workspace/projects/proginn-bituni:/proginn-bituni:rw
-      - /workspace/projects/proginn-child:/proginn-child:rw
-      - /workspace/projects/proginn-frontend:/proginn-frontend:rw
-      - /workspace/projects/festival:/festival:rw
-      - /workspace/projects/log/:/var/log/nginx
-      - /workspace/projects/log/:/data/log
-      - /workspace/projects/log/pm2:/var/www/.pm2/
-      - /workspace/projects:/data
-      - /workspace/proginn2/secrets:/data/secrets
-      - /workspace/projects/waf/src:/etc/nginx/conf/waf
-      - /workspace/kaifain:/workspace/kaifain:rw
-      - /var/www/.ssh:/var/www/.ssh:ro
-      - /workspace/projects/docker-test/tp/.env:/proginn-user/.env:rw
-    command: /data/docker/shell/container-up.sh
-    networks:
-      proginn:
-        ipv4_address: 10.200.223.2
-    ulimits:
-      nofile:
-        soft: "1048576"
-        hard: "1048576"
-    environment:
-      - PROGINN_BRANCH=dev
-      - ROOTER_BRANCH=dev
-      - PROGINN_FRONTEND_BRANCH=dev
-      - HOSTNAME=dev.test.proginn.com
-      - ENV=test
-      - NODE_ENV=development
-    extra_hosts:
-      - "dev.test.proginn.com:172.17.255.24"
-      - "user.test.proginn.com:172.17.255.24"
-      - "dev.test-user.proginn.com:172.17.255.24"
-      - "dev.test-rooter.proginn.com:172.17.255.24"
-      - "dev.test-jishuin.proginn.com:172.17.255.24"
-      - "git.proginn.com:172.17.17.49"
-      - "git.gitinn.com:172.17.17.49"
-      - "www.gitinn.com:172.17.17.49"
-      - "www.proginn.com:172.17.66.177"
-networks:
-  proginn:
-    external: true

+ 0 - 566
yml/nginx.conf

@@ -1,566 +0,0 @@
-# 技术圈
-server {
-    listen 80;
-    server_name dev.test-jishuin.proginn.com;
-    root /code/web/phphub/public;
-    index index.php;
-    rewrite ^/user/(\d+)$ /u/$1 permanent;
-    rewrite ^/user/collect_article/(\d+)$ /jishuin/c/$1 permanent;
-    rewrite ^/c/([a-z0-9]+)$ /jishuin/c/$1 last;
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.php?s=$1  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
-        deny all;
-    }
-
-    location ^~ /user/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-    location ^~ /user/quit {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /topics/create {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-
-    location ~ /topics/\d+/edit {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-
-    location ^~ /file/proxyUpload {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location /ajax/getmessage {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location /api {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /.nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-    location ^~ /_nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-
-    location ^~ /uapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /wapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /sapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ~ \.php$ {
-        fastcgi_pass unix:/var/run/php7-fpm.sock;
-        fastcgi_index index.php;
-        include fastcgi_params;
-        fastcgi_param SCRIPT_FILENAME $request_filename;
-    }
-    access_log /data/log/jishuin.log proginn-logid;
-}
-# 解决方案
-server {
-    listen 80;
-    server_name dev.test-kaifain.proginn.com;
-
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
-        deny all;
-    }
-
-    location /api/v {
-        proxy_pass http://10.200.0.1:8811;
-        proxy_set_header Host $http_host;
-    }
-
-    location /_api {
-        proxy_pass http://10.200.0.1:8812;
-        proxy_set_header Host $http_host;
-    }
-
-    location /crpc {
-        proxy_pass http://10.200.0.1:8800;
-        proxy_set_header Host $http_host;
-    }
-
-    location /prpc {
-        proxy_pass http://10.200.0.1:8003;
-        proxy_set_header Host $http_host;
-    }
-
-    location / {
-      proxy_pass http://127.0.0.1:8810;
-      proxy_set_header Host dev.test-kaifain.proginn.com;
-    }
-
-    access_log /data/log/kafain.log proginn-logid;
-}
-# 兼职招聘
-server {
-    listen 80;
-    server_name dev.test-job.proginn.com;
-    root /proginn-frontend/dist/;
-    index index.html;
-
-    rewrite ^/d/([a-z0-9]+)$ /job/detail/$1 last;
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /job$1  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
-        deny all;
-    }
-    location ^~ /job {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-job.proginn.com;
-    }
-    location ^~ /user/quit {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /file/proxyUpload {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location /ajax/getmessage {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location /api {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /.nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-job.proginn.com;
-    }
-    location ^~ /_nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test-job.proginn.com;
-    }
-    access_log /data/log/job.log proginn-logid;
-}
-# proginn
-server {
-    listen 80;
-    server_name dev.test.proginn.com;
-
-    root /code/web/;
-    index index.php index.html index.htm;
-
-    rewrite ^/job/(.*)$ https://dev.test-job.proginn.com/$1 permanent;
-    # rewrite ^/kaifain/(?!(add|preview))$ http://dev.test-kaifain.proginn.com/$1 permanent;
-
-    location ^~ /u/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /uapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /wapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /sapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ~ ^/type/service$ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host $host;
-        proxy_set_header X-Request-Id $temp_request_id;
-    }
-
-     location ~ ^/company$ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host $host;
-        proxy_set_header X-Request-Id $temp_request_id;
-    }
-
-    location ^~ /l/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host $host;
-        proxy_set_header X-Request-Id $temp_request_id;
-    }
-
-    location ^~ /skill {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /works {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /s/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /consult {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /c/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.php?s=$1  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location /community {
-        rewrite ^/community(.*)$ https://dev.test-jishuin.proginn.com$1 permanent;
-    }
-
-    location /festival {
-        alias /festival/dist;
-        index index.html index.htm;
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /festival/index.html  last;
-            break;
-        }
-    }
-
-    location /oauth2 {
-        alias /code/web/openx/public/oauth2;
-        index index.php;
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /oauth2/index.php  last;
-            break;
-        }
-        location ~ \.php$ {
-            fastcgi_pass unix:/var/run/php7-fpm.sock;
-            fastcgi_index index.php;
-            include fastcgi_params;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-        }
-    }
-
-    location /openapi {
-        alias /code/web/openx/public/api;
-        index index.php;
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /openapi/index.php  last;
-            break;
-        }
-        location ~ \.php$ {
-            fastcgi_pass unix:/var/run/php7-fpm.sock;
-            fastcgi_index index.php;
-            include fastcgi_params;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-        }
-    }
-
-    location ~ \.php$ {
-        fastcgi_pass unix:/var/run/php7-fpm.sock;
-        fastcgi_index index.php;
-        include fastcgi_params;
-    }
-
-    location ^~ /type/vip {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /cert {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /group {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /kaifain/add {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /kaifain/preview {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /setting/check/old_mobile {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /setting/check/real_info {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /setting/check/change_mobile {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /user/register {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /.nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /_nuxt {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /wo/cash {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /sign/new {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /type/interview {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /type/partners/ {
-         proxy_pass http://127.0.0.1:3000;
-         proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /wo/bills {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /recruit/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /salary/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /salary/detail {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /credit {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /work_down {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /frontend/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /ccf/ {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /otherpage {
-        proxy_pass http://127.0.0.1:3000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /upload_image {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-    location ^~ /Public/ {
-        # 匹配任何以 /Public/ 开头的地址,匹配符合以后,停止往下搜索正则,采用这一条。
-        expires 1d;
-        access_log off;
-    }
-
-    access_log /data/log/access.log proginn-logid;
-}
-
-# 新后台
-server {
-    listen 80;
-    server_name dev.test-rooter.proginn.com;
-
-    root /boss/dist;
-    index index.html index.htm;
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.html  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-    location /api {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /upload_image {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test-jishuin.proginn.com;
-    }
-
-    location ^~ /uapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    location ^~ /wapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-
-    location ^~ /sapi {
-        proxy_pass http://127.0.0.1:5000;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-
-    access_log /data/log/boss.log proginn-logid;
-}
-# festival
-server {
-    listen 80;
-    server_name dev.test-festival.proginn.com;
-
-    root /boss/dist;
-    index index.html index.htm;
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.html  last;
-            break;
-        }
-    }
-    location /api {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    location ^~ /upload_image {
-        proxy_pass http://127.0.0.1;
-        proxy_set_header Host dev.test.proginn.com;
-    }
-    access_log /data/log/festival.log proginn-logid;
-}
-
-# 用户模块
-server {
-    listen 5000;
-    server_name dev.test.proginn.com;
-
-    root /proginn-user/public/;
-    index index.php index.html index.htm;
-
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.php?s=$1  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location ~ \.php$ {
-        fastcgi_pass unix:/var/run/php7-fpm.sock;
-        fastcgi_index index.php;
-        include fastcgi_params;
-    }
-
-    access_log /data/log/user_proginn_access.log proginn-logid;
-}
-
-# bituni
-server {
-    listen 80;
-    server_name dev.test-bituni.proginn.com;
-
-    root /proginn-bituni/public/;
-    index index.php index.html index.htm;
-
-
-    location / {
-        if (!-e $request_filename) {
-            rewrite  ^(.*)$  /index.php?s=$1  last;
-            break;
-        }
-    }
-    set $temp_request_id $http_x_request_id;
-    if ($temp_request_id = "") {
-        set $temp_request_id $request_id;
-    }
-
-    location ~ \.php$ {
-        fastcgi_pass unix:/var/run/php7-fpm.sock;
-        fastcgi_index index.php;
-        include fastcgi_params;
-    }
-
-    access_log /data/log/user_proginn_access.log proginn-logid;
-}