From 66c2da8eb27c065a409165da5a597a2d60df1698 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期六, 30 三月 2024 21:47:01 +0800
Subject: [PATCH] nginx配置

---
 outsourcing.conf |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/outsourcing.conf b/outsourcing.conf
new file mode 100644
index 0000000..75ba02d
--- /dev/null
+++ b/outsourcing.conf
@@ -0,0 +1,38 @@
+server {
+    listen 80;
+    server_name outsourcing.fai365.com;
+
+    location / {
+        root /data/outsourcing/;
+        try_files $uri $uri/ /index.html last;
+        autoindex on;
+        index index.html index.htm;
+        error_page 405 =200 http://$host$request_uri;
+    }
+
+    location ^~/api-outsourcing/ {
+	lua_code_cache off;
+	set $proxy_outsourcing_server '';
+	access_by_lua '
+		local aps = require "resty.outsourcing"
+		outsourcing.proxy("/aps/apsServer/node/outsourcing/")
+	';
+	proxy_pass $proxy_outsourcing_server;
+	proxy_set_header  X-Forwarded-Host   $host;
+	proxy_set_header  X-Forwarded-Server $host;
+	proxy_set_header  X-Real-IP        $remote_addr;
+	proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
+	proxy_http_version 1.1;
+    }
+
+    location ^~/api/ {
+        proxy_pass  http://aps_user_server;
+        proxy_set_header  X-Forwarded-Host   $host;
+        proxy_set_header  X-Forwarded-Server $host;
+        proxy_set_header  X-Real-IP        $remote_addr;
+        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
+        proxy_http_version 1.1;
+    }
+
+    error_page 404 /index.html;
+}

--
Gitblit v1.8.0