Apache Nginx代理到后端允许不起作用,但拒绝起作用

Apache Nginx代理到后端允许不起作用,但拒绝起作用,apache,nginx,Apache,Nginx,我的目标是通过nginx将我的subdomain.domain.com代理到apache上的后端web.domain.domain.com。proxy_pass在nginx中工作,该部件正常 server { listen 80; server_name subdomain.domain.com; location / { proxy_pass http://web.domain.domain.com; }} 所以通过这种方式,我通过subdomain.domain.com将

我的目标是通过nginx将我的subdomain.domain.com代理到apache上的后端web.domain.domain.com。proxy_pass在nginx中工作,该部件正常

server {
listen 80;
server_name subdomain.domain.com;
location / {
 proxy_pass http://web.domain.domain.com;        
}}
所以通过这种方式,我通过subdomain.domain.com将web.domain.com带给世界 但我不知道每个人都可以访问什么,所以我知道nginx支持allow deny。当我向代码添加allow externalip和deny all时:

    server {
        listen 80;
        server_name subdomain.domain.com;
        location / {
allow xx.xx.xx.xx;
deny all;         
proxy_pass http://web.domain.domain.com;        
        }}
它应该允许ip访问subdomain.domain.com并拒绝世界其他地方,但它不能以这种方式工作,它会破坏一切,仅此而已 我发了很多帖子,但没有找到解决这个问题的办法
我使用的是nginx1.6版本

问题是我没有获得到达我的域的用户的真实ip,所以答案是我需要从我的HA代理发送真实ip

    set_real_ip_from  10.x.x.x;
    real_ip_header    X-Forwarded-For;
    real_ip_recursive on;

对不起,我的英语不好。没有帮助吗?有人能帮我吗?