Files
asset_helper/backend/gateway/nginx/conf.d/services/user-service.conf
fish 83d9a08b97 打通前后端联调链路
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 15:15:19 +08:00

66 lines
2.0 KiB
Plaintext

# 用户服务路由
# 账号登录(严格限流)
location /api/v1/auth/login/account {
limit_req zone=api_strict burst=5 nodelay;
limit_conn addr 3;
rewrite ^/api/v1/auth/login/account$ /login break;
proxy_pass http://user_login_account;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-ID $request_id;
}
# 邮箱登录(严格限流)
location /api/v1/auth/login/email {
limit_req zone=api_strict burst=5 nodelay;
limit_conn addr 3;
rewrite ^/api/v1/auth/login/email$ /login break;
proxy_pass http://user_login_email;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-ID $request_id;
}
# 账号注册(通用限流)
location /api/v1/users/register/account {
limit_req zone=general burst=20 nodelay;
limit_conn addr 10;
rewrite ^/api/v1/users/register/account$ /register break;
proxy_pass http://user_register_account;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-ID $request_id;
}
# 邮箱注册(通用限流)
location /api/v1/users/register/email {
limit_req zone=general burst=20 nodelay;
limit_conn addr 10;
rewrite ^/api/v1/users/register/email$ /register break;
proxy_pass http://user_register_email;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-ID $request_id;
}