zhangqian
2024-03-30 66c2da8eb27c065a409165da5a597a2d60df1698
nginx配置
1个文件已添加
38 ■■■■■ 已修改文件
outsourcing.conf 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
outsourcing.conf
New file
@@ -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;
}