Jelajahi Sumber

add config file

sanqi73 3 hari lalu
induk
melakukan
8b85d505c3
3 mengubah file dengan 62 tambahan dan 0 penghapusan
  1. 8 0
      S51myexe
  2. 3 0
      USER.conf
  3. 51 0
      nginx.conf

+ 8 - 0
S51myexe

@@ -0,0 +1,8 @@
+python /oem/usr/var/c4g.pyc &^M
+sleep 5^M
+python /oem/usr/var/main.pyc &^M
+sleep 5^M
+python /oem/usr/var/update.pyc &^M
+^M
+python -m flask --app /oem/usr/zhiyun/serve/server.py  run --host=0.0.0.0 &
+~

+ 3 - 0
USER.conf

@@ -0,0 +1,3 @@
+[conf]
+username = admin
+password = admin

+ 51 - 0
nginx.conf

@@ -0,0 +1,51 @@
+worker_processes  1;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    include       mime.types;
+    default_type  application/octet-stream;
+
+    access_log off;
+
+    add_header Access-Control-Allow-Origin *;
+    add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
+    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Range,Content-Type,Authorization';
+    add_header 'Access-Control-Expose-Headers' 'X-Location';
+
+    sendfile        on;
+
+    keepalive_timeout  65;
+
+    gzip  on;
+    gzip_min_length 20;
+    gzip_comp_level 5;
+    gzip_vary on;
+    gzip_types application/javascript application/x-javascript text/javascript image/png image/x-icon;
+    gzip_static on;
+    gzip_buffers 2 4k;
+    gzip_http_version 1.1;
+
+    server {
+        listen 80;
+        server_name localhost;
+
+        location / {
+            root /oem/usr/zhiyun/web/dist;  
+            try_files $uri $uri/ /index.html;  
+        }
+		
+        location /api {
+            proxy_pass http://127.0.0.1:5000;  # 转发到本地 5000 端口(Tauri 后端)
+            rewrite ^/api/(.*)$ /$1 break;  # 去掉 /api 前缀(因为后端接口是 /getConfig,不是 /api/getConfig)
+        }
+
+        error_page 500 502 503 504 /50x.html;
+        location = /50x.html {
+            root /usr/share/nginx/html;
+        }
+    }
+}
+