nginx允许ip不再在新网络上工作

时间:2018-04-08 18:08:32

标签: nginx

我最近搬家了,我和一家新的互联网提供商一起为我提供了一台运行在192.168.1.254的ZTE ZXHN H298A路由器。

我之前的互联网服务提供商的路由器运行在192.168.0.1

所以在我的nginx配置中我有以下内容允许我访问我的代理网站而无需使用我的http basic auth

   satisfy any;
 allow 192.168.0.1/24;

在我的新网络上我更新了它以阅读

   satisfy any;
 allow 192.168.1.0/24;

由于某种原因,它仍然一直要求用户和密码,在主机上访问时给定的是在固定的192.168.1.3上运行

这是我的完整配置

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    server_names_hash_bucket_size 64;


    server {
  listen 80;
  server_name _;
  rewrite ^ https://$host$request_uri? permanent;


   }

  server {
        listen 443 ssl;
        server_name  mydomain.com, 192.168.1.3;


       satisfy any;
     allow 192.168.1.0/24;

    ssl_certificate mydomain.crt;
    ssl_certificate_key mydomain.key;

    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    ssl_dhparam dhparam.pem;

    location /{
            root   html;
            index  index.php





        auth_basic "closed site";
        auth_basic_user_file .htpasswd;

        }


        location /plexemail {
           root C:\Plexemail\web;
           }





            location /web {
        proxy_pass http://127.0.0.1:32400;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }


        location /nzbget {
        proxy_pass http://192.168.1.3:6789;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;
        auth_basic "closed site";
        auth_basic_user_file .htpasswd;
        }

      location /plexpy {
        proxy_pass http://127.0.0.1:8181/plexpy;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      satisfy any;
      allow 192.168.1.0/24;
        auth_basic "closed site";
        auth_basic_user_file .htpasswd;
        }

    location /lazylib {
  proxy_pass http://127.0.0.1:5299;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    satisfy any;
    allow 192.168.1.0/24;
  auth_basic "closed site";
      auth_basic_user_file .htpasswd;
  }

    location /mylar {
        proxy_pass http://127.0.0.1:8090;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;

        auth_basic "closed site";
        auth_basic_user_file .htpasswd;
        }


        location /htpc {
        proxy_pass http://127.0.0.1:8085;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          satisfy any;
      allow 192.168.1.0/24;
        auth_basic "closed site";
        auth_basic_user_file .htpasswd;

        }

                location /nzbhydra {
        proxy_pass http://127.0.0.1:5075;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


    }
        location /sonarr {
        proxy_pass http://127.0.0.1:8989;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;

        auth_basic "closed site";
        auth_basic_user_file .htpasswd;

    }
    location /radarr {
        proxy_pass http://127.0.0.1:7878;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;
        auth_basic "closed site";
        auth_basic_user_file .htpasswd;


            }
     location /deluge {
        proxy_pass http://127.0.0.1:7741/;
        proxy_set_header X-Deluge-Base "/deluge/";
              satisfy any;
      allow 192.168.1.0/24;

        auth_basic "closed site";
        auth_basic_user_file .htpasswd;

                    }

          location /ombi {
              return 301 $scheme://$host/ombi/;
         }
         location /ombi/ {
             proxy_pass http://127.0.0.1:5000;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-Host $server_name;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Forwarded-Ssl on;
             proxy_set_header X-Forwarded-Proto $scheme;
             proxy_read_timeout  90;
             proxy_redirect http://127.0.0.1:5000 https://$host;
         }
         if ($http_referer ~* /ombi/) {
                 rewrite ^/dist/(.*) $scheme://$host/ombi/dist/$1 permanent;
         }

     location /comics/admin {
        proxy_pass http://localhost:2203/comics/admin;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;

        auth_basic "closed site";
        auth_basic_user_file .htpasswd;


                        }
     location /comics {
        proxy_pass http://192.168.1.3:2202;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              satisfy any;
      allow 192.168.1.0/24;

        auth_basic "closed site";
        auth_basic_user_file .htpasswd;


                        }

        location /phlex {
            proxy_pass http://192.168.1.13:5123/Phlex;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  satisfy any;
             allow 192.168.1.0/24;
                        }


     location /calendar{
        proxy_pass http://192.168.1.3:8989/sonarr/feed/calendar/NzbDrone.ics?apikey=myapi;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


            location ~ .php$ {
    root           html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  C:/nginx-1.8.0/html/$fastcgi_script_name;
    include        fastcgi_params;
    }

    }

有人可以帮助我,这让我发疯了

0 个答案:

没有答案