蛋蛋星球-客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

222 lines
7.1 KiB

  1. limit_req_zone $binary_remote_addr zone=mylimit:20m rate=5r/s;
  2. server {
  3. listen 80;
  4. server_name _;
  5. root /usr/share/nginx/html;
  6. #将DNS指向kubernetes集群内的DNS
  7. resolver kube-dns.kube-system.svc.cluster.local valid=30s;
  8. set $oss_endpoint_service zhios-oss.zhios.svc.cluster.local:5000;
  9. set $mall_service zhios-mall.zhios.svc.cluster.local:5002;
  10. set $domain_server zhios-request-domain.zhios.svc.cluster.local:4040;
  11. set $agent_endpoint_service zhios-app-comm.zhios.svc.cluster.local:5003;
  12. set $o2ob_endpoint_service zhios-app-o2o.zhios.svc.cluster.local:5004;
  13. set $adset_callback_endpoint_service app-comm-adset-callback.zhios.svc.cluster.local:5505;
  14. set $b2c_customer_service zyos-b2c-customer.zhios.svc.cluster.local:5009;
  15. set $chat_gpt_service chat-gpt.zhios.svc.cluster.local:5200;
  16. set $live_broadcast_video_service zyos-live-broadcast-video.zhios.svc.cluster.local:5010;
  17. set $o2oc_endpoint_service zhios-app-o2o-customer.zhios.svc.cluster.local:5005;
  18. set $endpoint_service zhios-app.zhios.svc.cluster.local:5000;
  19. set $community_team_service community-team.zhios.svc.cluster.local:6001;
  20. set $super_cloud_issuance_service super-cloud-issuance.zhios.svc.cluster.local:3001;
  21. location /api/v1/chatGpt {
  22. limit_req zone=mylimit burst=5 nodelay;
  23. proxy_pass http://$chat_gpt_service;
  24. proxy_http_version 1.1;
  25. proxy_set_header Origin "";
  26. proxy_set_header Host $host;
  27. proxy_set_header X-Real-Scheme $scheme;
  28. proxy_set_header X-Real-IP $remote_addr;
  29. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  30. proxy_set_header Upgrade $http_upgrade;
  31. proxy_set_header Connection 'upgrade';
  32. break;
  33. }
  34. location /api/v1/communityTeam {
  35. limit_req zone=mylimit burst=5 nodelay;
  36. proxy_pass http://$community_team_service;
  37. proxy_http_version 1.1;
  38. proxy_set_header Origin "";
  39. proxy_set_header Host $host;
  40. proxy_set_header X-Real-Scheme $scheme;
  41. proxy_set_header X-Real-IP $remote_addr;
  42. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43. proxy_set_header Upgrade $http_upgrade;
  44. proxy_set_header Connection 'upgrade';
  45. break;
  46. }
  47. location /api/v1/superCloudIssuance {
  48. limit_req zone=mylimit burst=5 nodelay;
  49. proxy_pass http://$super_cloud_issuance_service;
  50. proxy_http_version 1.1;
  51. proxy_set_header Origin "";
  52. proxy_set_header Host $host;
  53. proxy_set_header X-Real-Scheme $scheme;
  54. proxy_set_header X-Real-IP $remote_addr;
  55. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56. proxy_set_header Upgrade $http_upgrade;
  57. proxy_set_header Connection 'upgrade';
  58. break;
  59. }
  60. location = / {
  61. limit_req zone=mylimit burst=5 nodelay;
  62. proxy_pass http://$endpoint_service;
  63. proxy_http_version 1.1;
  64. proxy_set_header Connection "";
  65. proxy_set_header Host $host;
  66. proxy_set_header Platform "wap";
  67. proxy_set_header X-Real-IP $remote_addr;
  68. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  69. break;
  70. }
  71. location /getDomain {
  72. limit_req zone=mylimit burst=5 nodelay;
  73. proxy_pass http://$domain_server;
  74. proxy_set_header Host $host;
  75. proxy_set_header X-Real-IP $remote_addr;
  76. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  77. break;
  78. }
  79. location /static {
  80. limit_req zone=mylimit burst=5 nodelay;
  81. root /usr/share/nginx/html;
  82. index index.html index.htm;
  83. }
  84. location /api/v1/mall {
  85. limit_req zone=mylimit burst=5 nodelay;
  86. proxy_pass http://$mall_service;
  87. proxy_set_header Connection "";
  88. proxy_set_header Host $host;
  89. proxy_set_header X-Real-IP $remote_addr;
  90. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  91. break;
  92. }
  93. location /api/v1/comm/adset {
  94. limit_req zone=mylimit burst=5 nodelay;
  95. proxy_pass http://$adset_callback_endpoint_service;
  96. proxy_set_header Connection "";
  97. proxy_set_header Host $host;
  98. proxy_set_header X-Real-IP $remote_addr;
  99. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100. break;
  101. }
  102. location /api/v2/comm {
  103. limit_req zone=mylimit burst=5 nodelay;
  104. proxy_pass http://$agent_endpoint_service;
  105. proxy_set_header Connection "";
  106. proxy_set_header X-Real-IP $remote_addr;
  107. proxy_set_header Host $host;
  108. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  109. break;
  110. }
  111. location /api/v1/comm {
  112. limit_req zone=mylimit burst=5 nodelay;
  113. proxy_pass http://$agent_endpoint_service;
  114. proxy_set_header Connection "";
  115. proxy_set_header X-Real-IP $remote_addr;
  116. proxy_set_header Host $host;
  117. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  118. break;
  119. }
  120. # o2o c端
  121. location /api/v1/o2oc {
  122. limit_req zone=mylimit burst=5 nodelay;
  123. proxy_pass http://$o2oc_endpoint_service;
  124. proxy_set_header Connection "";
  125. proxy_set_header X-Real-IP $remote_addr;
  126. proxy_set_header Host $host;
  127. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  128. break;
  129. }
  130. # o2o商家端
  131. location /api/v1/o2o {
  132. limit_req zone=mylimit burst=5 nodelay;
  133. proxy_pass http://$o2ob_endpoint_service;
  134. proxy_set_header Connection "";
  135. proxy_set_header X-Real-IP $remote_addr;
  136. proxy_set_header Host $host;
  137. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  138. break;
  139. }
  140. # 多用户商城c端
  141. location /api/v1/b2cc {
  142. limit_req zone=mylimit burst=5 nodelay;
  143. proxy_pass http://$b2c_customer_service;
  144. proxy_set_header Connection "";
  145. proxy_set_header X-Real-IP $remote_addr;
  146. proxy_set_header Host $host;
  147. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  148. break;
  149. }
  150. location /api/v1/live_room {
  151. limit_req zone=mylimit burst=5 nodelay;
  152. proxy_pass http://$endpoint_service;
  153. #istio下http协议必须大于等于1.1
  154. proxy_http_version 1.1;
  155. proxy_set_header Connection "";
  156. proxy_set_header Host $host;
  157. proxy_set_header X-Real-IP $remote_addr;
  158. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  159. break;
  160. }
  161. location /api/v1/live {
  162. limit_req zone=mylimit burst=5 nodelay;
  163. proxy_pass http://$live_broadcast_video_service;
  164. proxy_set_header Connection "";
  165. proxy_set_header X-Real-IP $remote_addr;
  166. proxy_set_header Host $host;
  167. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  168. break;
  169. }
  170. location /api/qiniu {
  171. limit_req zone=mylimit burst=5 nodelay;
  172. proxy_pass http://$oss_endpoint_service;
  173. proxy_set_header Connection "";
  174. proxy_set_header Host $host;
  175. proxy_set_header X-Real-IP $remote_addr;
  176. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  177. break;
  178. }
  179. #proxy server
  180. location /api {
  181. limit_req zone=mylimit burst=5 nodelay;
  182. proxy_pass http://$endpoint_service;
  183. #istio下http协议必须大于等于1.1
  184. proxy_http_version 1.1;
  185. proxy_set_header Connection "";
  186. proxy_set_header Host $host;
  187. proxy_set_header X-Real-IP $remote_addr;
  188. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  189. break;
  190. }
  191. }