Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修改gateway的Nginx配置,ai和auth的接口前加v1 #1245

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/gateway/assets/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ server {
include includes/websocket;
}

# ai中将/v1/ai/xxx,重写成/ai/v1/xxx并代理到/ai/v1/xxx
location ${BASE_PATH}v1${AI_PATH} {
rewrite ^${BASE_PATH}v1${AI_PATH}/(.*) ${AI_PATH}/v1/$1 break;
set $ai_path_url ${AI_PATH_INTERNAL_URL};
proxy_pass $ai_path_url;

include includes/headers;
include includes/websocket;
}

location ${BASE_PATH}${VNC_PATH} {
proxy_pass ${NOVNC_INTERNAL_URL};

Expand All @@ -57,6 +67,14 @@ server {
include includes/headers;
}

#在auth中public接口也加上前缀v1
location ~ ^${BASE_PATH}/v1/auth/public/(.*) {
set $auth ${AUTH_URL};
proxy_pass $auth/public/$1?$args;

include includes/headers;
}

error_page 500 502 503 504 /50x.html;

location = /__basic_status__ {
Expand Down