Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Nginx Allow Deny Block Mix Ipv4 and Ipv6
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx Allow Deny Block Mix Ipv4 and Ipv6

I don't know what to do now.
Need help. This the first time I encountered this.

listen 443 ssl;
listen [::]:443 ssl;
include snippets/subdomain.example.tld.conf;

    root /srv/tools/phpMyAdmin-5.0.4-all-languages;
    index index.php;

    server_name subdomain.example.tld;


    location / {
     
     allow 2001:XX:XX-----;
     # allow [2001:XX:XX-----]; // error
     allow xx.xx.xxx.xx;
     deny all;
     try_files $uri $uri/ =404;
    }

When I tried this I always get the 403 (Forbidden error from nginx);

What is the proper way to allow a mix of Ipv4 and Ipv6?
Thanks for the help in advance.

Comments

  • team_traitorteam_traitor Member
    edited October 2020

    not working. I tried that before I posted here.

    [warn] low address bits of 2001:67c:2628:647:12::/32 are meaningless in /etc/nginx/conf.d/

    tcp        0      0 localhost:mysql         0.0.0.0:*               LISTEN     
    tcp        0      0 0.0.0.0:http            0.0.0.0:*               LISTEN     
    tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN     
    tcp        0      0 0.0.0.0:5372            0.0.0.0:*               LISTEN     
    tcp6       0      0 [::]:http               [::]:*                  LISTEN     
    tcp6       0      0 [::]:https              [::]:*                  LISTEN     
    tcp6       0      0 [::]:5372               [::]:*                  LISTEN    
    
  • kerus1024kerus1024 Member
    edited October 2020

    2001

  • @kerus1024 said:
    2001:67c:2628:647:12::/32 allow 2001:67c:2628:647:12::/80

    not working too. but the syntax is okay according to nginx.
    Still I get a 403 Forbidden. :-(

  • LESLES Member
    edited October 2020

    Is this IP from your home ISP?

  • It turns that there is a problem with Ipv6 on my vps.
    I get a this message when I ping Ipv6 enable website inside my box.

    debian@vps-xxxx:~$ ping6 ipv6.google.com
    connect: Network is unreachable
    debian@vps-xxxx:~$ 
    

    I use the opera vpn (which gives Ipv6 as a test).
    I don't have much time to spare so I figure this out next time. Thanks for the help guys. LET never let me down.

Sign In or Register to comment.