- サーバーの ipv6 のアドレスを調べます
$ ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2400:8500:1302:802:133:130:124:81/128 scope global dynamic noprefixroute
2400:8500:1302:802:133:130:124:81 がアドレスになります。
- ping で確認
$ ping -6 -c 3 2400:8500:1302:802:133:130:124:81
PING 2400:8500:1302:802:133:130:124:81(2400:8500:1302:802:133:130:124:81) 56 data bytes
64 bytes from 2400:8500:1302:802:133:130:124:81: icmp_seq=1 ttl=63 time=0.693 ms
64 bytes from 2400:8500:1302:802:133:130:124:81: icmp_seq=2 ttl=63 time=0.471 ms
64 bytes from 2400:8500:1302:802:133:130:124:81: icmp_seq=3 ttl=63 time=0.555 ms
ping で確認
ping -6 -c 3 abc.example.com
>dig で確認
>```text
$ dig -t AAAA abc.example.com +short
2400:8500:1302:802:133:130:124:81
- Nginx の設定
/etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
(省略)
設定ファイルが正しいことを確認
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
>Nginx を再起動
>```bash
sudo systemctl restart nginx
- ブラウザーで ipv6 でアクセス