Browse Source

Merge pull request #2641 from ArtARTs36/patch-1

feat: pass X-Real-IP header to gRPC Backend
Nicolas Duchon 2 tháng trước cách đây
mục cha
commit
a2bdbcd3ed
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      nginx.tmpl

+ 2 - 0
nginx.tmpl

@@ -321,8 +321,10 @@
             {{- end }}
         {{- else if eq $proto "grpc" }}
         grpc_pass {{ trim $proto }}://{{ trim $upstream }};
+        grpc_set_header X-Real-IP $remote_addr;
         {{- else if eq $proto "grpcs" }}
         grpc_pass {{ trim $proto }}://{{ trim $upstream }};
+        grpc_set_header X-Real-IP $remote_addr;
         {{- else }}
         proxy_pass {{ trim $proto }}://{{ trim $upstream }}{{ trim $dest }};
         set $upstream_keepalive {{ if ne $keepalive "disabled" }}true{{ else }}false{{ end }};