Nginx:如何基于请求标头反向代理?

时间:2018-11-06 13:27:22

标签: nginx

示例设置

from tkinter import Tk, Label
from PIL import Image, ImageTk

root = Tk()

file = '/home/master/Work/Tensorflow/Project06 - LSC_CVPPP/Data/00 - Backgrounds_org/A1/plant001.png'

image = Image.open(file)

zoom = 0.5

#multiple image zise by zoom
pixels_x, pixels_y = tuple([int(zoom * x)  for x in image.size])

img = ImageTk.PhotoImage(image.resize((pixels_x, pixels_y))) # the one-liner I used in my app
label = Label(root, image=img)
label.image = img # this feels redundant but the image didn't show up without it in my app
label.pack()

root.mainloop()

要求

  • 我想将浏览器请求转发到 Client Nginx ↙ ↘ Frontend Server Git server
  • 我想将Git请求转发到Frontend server
  • 我希望阻止所有Git server个请求

问题

  • 如何根据请求标头反向代理;因为任何git req是 格式为curl/wgetGET /info/refs?service=git-upload-pack HTTP/1.1
  • 如何使用GET /info/refs?service=git-receive-pack HTTP/1.1阻止传入的请求?

0 个答案:

没有答案
相关问题