我正在尝试将Nginx配置为http://example.com/test/app
的代理我的配置类似于:
class MyAction(argparse._StoreTrueAction):
def __init__(self, *args, **kwargs):
super(MyAction, self).__init__(*args,**kwargs)
self.default=argparse.SUPPRESS
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, 'flaga', True)
setattr(namespace, 'flagb', True)
我得到了301回复。我不认为这是代理所指的网络应用程序,因为它的网址可以通过浏览器访问。
我对Nginx很新。请帮忙。 :)
答案 0 :(得分:1)
请尝试以下最低配置:
server {
listen 80;
location / {
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;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass http://example.com/test/app;
proxy_read_timeout 90;
}
}
请注意,此示例中缺少安全方面。