0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ipv6 で Nginx にアクセスする

Last updated at Posted at 2021-05-25
  1. サーバーの 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 がアドレスになります。

  1. 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
  1. DNS で AAAA レコードを登録
    onamae.com だと次のようになります。
    onamae_may25.png

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
  1. 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
  1. ブラウザーで ipv6 でアクセス

http://[2400:8500:1302:802:133:130:124:81]

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?