Skip to content

Commit

Permalink
修正nginx反向代理BUG
Browse files Browse the repository at this point in the history
修正nginx反向代理BUG
  • Loading branch information
ZongXR committed Mar 26, 2022
1 parent 50fa1fd commit f91066c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions start_up/app/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,55 @@ http {
}
# 商品微服务
location ^~/products {
proxy_pass http://supermarket-product-1:10001/product/manage/;
proxy_pass http://supermarket-gateway-1:10001/product/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 图片上传
location ^~/uploadImg {
proxy_pass http://supermarket-image-1:10001/pic/upload/;
proxy_pass http://supermarket-gateway-1:10001/pic/upload/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 验证码
location ^~/valistr {
proxy_pass http://supermarket-image-1:10001/pic/valistr/;
proxy_pass http://supermarket-gateway-1:10001/pic/valistr/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 删除验证码缓存
location ^~/valistrdel {
proxy_pass http://supermarket-image-1:10001/pic/valistrdel/;
proxy_pass http://supermarket-gateway-1:10001/pic/valistrdel/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 用户微服务
location ^~/user {
proxy_pass http://supermarket-user-1:10001/user/manage/;
proxy_pass http://supermarket-gateway-1:10001/user/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 购物车微服务
location ^~/cart {
proxy_pass http://supermarket-cart-1:10001/cart/manage/;
proxy_pass http://supermarket-gateway-1:10001/cart/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 订单微服务
location ^~/order {
proxy_pass http://supermarket-order-1:10001/order/manage/;
proxy_pass http://supermarket-gateway-1:10001/order/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 检索微服务
location ^~/searchs {
proxy_pass http://supermarket-search-1:10001/search/manage/;
proxy_pass http://supermarket-gateway-1:10001/search/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
# 秒杀微服务
location ^~/instantbuy {
proxy_pass http://supermarket-instantbuy-1:10001/instantbuy/manage/;
proxy_pass http://supermarket-gateway-1:10001/instantbuy/manage/;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Origin' '*';
}
Expand Down

0 comments on commit f91066c

Please sign in to comment.