rabin 5 years ago
parent
commit
4bc1e0f1c1

+ 23 - 33
container/conf/web/nginx/conf.d/domain.conf

@@ -8,54 +8,44 @@ server {
 
     charset $charset;
 
-    set $rootdir /www/jiaoyou20190507/public;
+    #set $rootdir /www/jiaoyou20190507/public;
+    set $rootdir /www/txhl-zsc/fxb-front;
     root $rootdir;
     index index.php index.html;
-
-    set $rewrite yes;
-
-    location ~ ^/favicon\.ico$ {
-        root $rootdir;
+    if ( $request_uri ~* /(applet\/content|applet_on\/content) ) {
+            rewrite ^/(.*)/content/(.*) /$1/content/index.php?$2 last;
     }
-    
-    location ~* (.*).tpl {
-        return 404;
+    if ( $request_uri ~* /log\/data.add ) {
+            rewrite ^/log/(.*?) /log/index.php?$1 last;
     }
-
-    if ( $request_uri ~* ^/(doc\/|public\/|upload\/|assets\/|static\/|crossdomain\.xml|index\.php|favicon\.ico) ) {
-        set $rewrite no;
+    if ( $request_uri ~* /system/wechat ) {
+            rewrite ^/system/wechat /system/index.php?m=payment&a=wechat_notify last;
     }
-
-
-    if ($rewrite ~* yes) {
-        rewrite ^/(.*) /index.php/$1 last;
-    }
-
-    location ~ /(doc\/|upload\/|public\/|assets\/|static\/|crossdomain\.xml)
-    {
-        try_files $uri $uri/ /index.html;
+    if ( $request_uri ~* /pay/pay/notify ) {
+            rewrite ^/pay/pay/notify/([0-9+]) /pay/pay/index.php?l=api.notify&account_id=$1 last;
     }
-
-    location /doc/ {
-		try_files $uri $uri/ /index.html;
+    location / {
+                # First attempt to serve request as file, then
+                # as directory, then fall back to displaying a 404.
+                try_files $uri $uri/ =404;
+                # Uncomment to enable naxsi on this location
+                # include /etc/nginx/naxsi.rules
     }
 
-    location ~ ^(.*)$ {
-        #add_header Access-Control-Allow-Origin http://192.168.0.109:8080;
-        #add_header Access-Control-Allow-Headers X-Requested-With;
-       # add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
-        #add_header Access-Control-Allow-Credentials true;
+    #location ~ ^(.*)$ {
+    location ~ \.php$ {
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
-        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
+        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini (No settings!)
 
         # With php-cgi alone:
+        #fastcgi_pass web-php7_swoole:9000;
         fastcgi_pass web-php7:9000;
-        #fastcgi_pass onepage-php5:9000;
+        #fastcgi_pass web-php5:9000;
         # With php-fpm:
         #fastcgi_pass unix:/var/run/php7-fpm.sock;
         fastcgi_index index.php;
-        fastcgi_param  SCRIPT_FILENAME  $rootdir/index.php;
-        fastcgi_param  PATH_INFO $fastcgi_path_info;
+        fastcgi_param  SCRIPT_FILENAME  $rootdir/$fastcgi_script_name;
+        #fastcgi_param  PATH_INFO $fastcgi_path_info;
         include fastcgi_params;
     }
 }

+ 1 - 1
container/conf/web/nginx/fastcgi_params

@@ -20,7 +20,7 @@ fastcgi_param  REMOTE_PORT        $remote_port;
 fastcgi_param  SERVER_ADDR        $server_addr;
 fastcgi_param  SERVER_PORT        $server_port;
 fastcgi_param  SERVER_NAME        $server_name;
-fastcgi_param  REDIRECT_URL       test;
+#fastcgi_param  REDIRECT_URL       test;
 
 # PHP only, required if PHP was built with --enable-force-cgi-redirect
 fastcgi_param  REDIRECT_STATUS    200;

+ 20 - 0
src/docker/build/tool/walle/Dockerfile

@@ -0,0 +1,20 @@
+FROM docker.dever.cc/os/alpine:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+RUN apk add --no-cache --update nginx mysql-client python py-virtualenv && \
+	mkdir /run/nginx/ && \
+	rm -rf /etc/nginx/conf.d/default.conf && \
+	pip install virtualenv && \
+	pip install flask && \
+	git clone https://github.com/meolu/walle-web.git /walle-web && \
+	cd /walle-web && \
+	sh admin.sh init && \
+	virtualenv --no-site-packages -p python venv && \
+	sed -i "s/user:password@localhost:3306/root:123456@web-mysql:3306/g" /walle-web/walle/config/settings_prod.py && \
+	mysql  -hweb-mysql -uroot -p123456 -e 'CREATE SCHEMA walle' && \
+	sh admin.sh migration && \
+
+
+#COPY walle.sh /entrypoint/walle.sh
+#COPY walle.conf /etc/nginx/conf.d/walle.conf

+ 41 - 0
src/docker/build/tool/walle/walle.conf

@@ -0,0 +1,41 @@
+upstream webservers {
+    server 0.0.0.0:5000 weight=1; # 负载设置
+}
+
+server {
+    listen       80;
+    server_name  admin.walle-web.io; # 域名设置
+    access_log   /usr/local/nginx/logs/walle.log main;
+    index index.html index.htm; # 日志目录
+
+    location / {
+        try_files $uri $uri/ /index.html;
+        add_header access-control-allow-origin *;
+        root /walle-web/fe; # 前端代码已集成到walle-web,即walle-web/fe的绝对路径
+    }
+
+    location ^~ /api/ {
+        add_header access-control-allow-origin *;
+        proxy_pass      http://webservers;
+        proxy_set_header X-Forwarded-Host $host:$server_port;
+        proxy_set_header  X-Real-IP  $remote_addr;
+        proxy_set_header    Origin        $host:$server_port;
+        proxy_set_header    Referer       $host:$server_port;
+    }
+
+    location ^~ /socket.io/ {
+        add_header access-control-allow-origin *;
+        proxy_pass      http://webservers;
+        proxy_set_header X-Forwarded-Host $host:$server_port;
+        proxy_set_header  X-Real-IP  $remote_addr;
+        proxy_set_header    Origin        $host:$server_port;
+        proxy_set_header    Referer       $host:$server_port;
+        proxy_set_header Host $http_host;
+        proxy_set_header X-NginX-Proxy true;
+
+        # WebScoket Support
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+    }
+}

+ 18 - 0
src/docker/build/tool/walle/walle.sh

@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+set -e
+
+start_nginx()
+{
+	#exec nginx
+	process_start nginx
+}
+
+stop_nginx()
+{
+    nginx -s stop
+}
+
+monit_nginx()
+{
+	process_monit nginx
+}

+ 6 - 1
src/docker/conf/tool.conf

@@ -59,4 +59,9 @@ image = ffmpeg
 volumes = {container}web/mc/data:/tmp
 call = ffmpeg
 param = -i /tmp/001.avi -vcodec libx264 -threads 2 -preset fast -crf 28 -y -vf "scale=1920:-1" -acodec libmp3lame -ab 128k /tmp/out.mp4
-alias = ffmpeg
+alias = ffmpeg
+
+;walle
+[walle]
+image = walle
+port = 8080:80,5000:5000

+ 1 - 0
src/docker/core.conf

@@ -81,6 +81,7 @@ pan					= tool/pan
 vsftpd				= tool/vsftpd
 nextcloud           = tool/nextcloud
 ffmpeg				= tool/ffmpeg
+walle				= tool/walle
 
 ;learn
 learn				= learning