Eu recentemente alterei meu arquivo /etc/hosts
para poder me conectar diretamente ao meu servidor por meio de seu IP interno (em vez de usar a largura de banda da Internet enviando dados para fora da nossa intranet). Aqui está a totalidade de /etc/hosts
; a linha final é nova.
127.0.0.1 localhost.localdomain localhost protist-XPS-17
::1 localhost.localdomain localhost protist-XPS-17
191.168.1.91 foo.dynu.com
Em um nível, parece estar redirecionando bem, porque vejo o endereço IP quando eu ping
.
$ ping foo.dynu.com
PING foo.dynu.com (191.168.1.91) 56(84) bytes of data.
64 bytes from foo.dynu.com (191.168.1.91): icmp_seq=1 ttl=46 time=490 ms
No entanto, não consigo mais me conectar à página da Web do servidor por meio do nome do domínio. Conectar-se a https://192.168.1.91
funciona bem, mas https://foo.dynu.com
apenas diz Unable to connect
no Firefox e ERR_CONNECTION_REFUSED
no Chromium. Não consigo encontrar nada nos logs do meu servidor. O que mudou e como faço para corrigir isso?
Eu também posso conectar usando o IP público. Um traceroute
mostra a conexão saindo para o nó do meu provedor e, em seguida, diretamente de volta.
Eu tentei executar tcpdump
. A tentativa de se conectar à falha foo.dynu.com
sugere que o destino seja foo.dynu.com.https
. No entanto, se eu me conectar ao endereço IP interno de trabalho 192.168.1.91
, o destino será pi.lan.https
. Presumivelmente, esta é a fonte do erro, mas não sei como corrigi-lo.
$ sudo tcpdump host foo.dynu.com -vv
tcpdump: listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
07:55:07.153290 IP (tos 0x0, ttl 64, id 19682, offset 0, flags [DF], proto TCP (6), length 60)
sparhawk-xps-17.lan.48740 > foo.dynu.com.https: Flags [S], cksum 0xdc0e (correct), seq 1155879667, win 29200, options [mss 1460,sackOK,TS val 14360081 ecr 0,nop,wscale 7], length 0
07:55:07.403579 IP (tos 0x0, ttl 64, id 15739, offset 0, flags [DF], proto TCP (6), length 60)
sparhawk-xps-17.lan.48742 > foo.dynu.com.https: Flags [S], cksum 0xffbf (correct), seq 1353917223, win 29200, options [mss 1460,sackOK,TS val 14360156 ecr 0,nop,wscale 7], length 0
07:55:07.593380 IP (tos 0x0, ttl 44, id 5433, offset 0, flags [DF], proto TCP (6), length 40)
foo.dynu.com.https > sparhawk-xps-17.lan.48740: Flags [R.], cksum 0xd4da (correct), seq 0, ack 1155879668, win 0, length 0
07:55:07.900561 IP (tos 0x0, ttl 44, id 5434, offset 0, flags [DF], proto TCP (6), length 40)
foo.dynu.com.https > sparhawk-xps-17.lan.48742: Flags [R.], cksum 0xf8d6 (correct), seq 0, ack 1353917224, win 0, length 0
07:55:07.901015 IP (tos 0x0, ttl 64, id 12982, offset 0, flags [DF], proto TCP (6), length 60)
sparhawk-xps-17.lan.48744 > foo.dynu.com.https: Flags [S], cksum 0xc019 (correct), seq 2258775111, win 29200, options [mss 1460,sackOK,TS val 14360305 ecr 0,nop,wscale 7], length 0
07:55:08.310080 IP (tos 0x0, ttl 44, id 5446, offset 0, flags [DF], proto TCP (6), length 40)
foo.dynu.com.https > sparhawk-xps-17.lan.48744: Flags [R.], cksum 0xb9c5 (correct), seq 0, ack 2258775112, win 0, length 0
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
$ sudo tcpdump host 192.168.1.91 -vv
tcpdump: listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
07:57:41.863114 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has pi.lan tell sparhawk-xps-17.lan, length 28
07:57:41.864312 ARP, Ethernet (len 6), IPv4 (len 4), Reply pi.lan is-at b8:27:eb:04:03:78 (oui Unknown), length 46
07:57:41.864321 IP (tos 0x0, ttl 64, id 21232, offset 0, flags [DF], proto TCP (6), length 60)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [S], cksum 0xf30a (correct), seq 689209774, win 29200, options [mss 1460,sackOK,TS val 14406494 ecr 0,nop,wscale 7], length 0
07:57:41.866298 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [S.], cksum 0xbb64 (correct), seq 642621490, ack 689209775, win 28960, options [mss 1460,sackOK,TS val 176318339 ecr 14406494,nop,wscale 7], length 0
07:57:41.866336 IP (tos 0x0, ttl 64, id 21233, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x5a6b (correct), seq 1, ack 1, win 229, options [nop,nop,TS val 14406495 ecr 176318339], length 0
07:57:41.866651 IP (tos 0x0, ttl 64, id 21234, offset 0, flags [DF], proto TCP (6), length 228)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [P.], cksum 0xa844 (correct), seq 1:177, ack 1, win 229, options [nop,nop,TS val 14406495 ecr 176318339], length 176
07:57:41.869069 IP (tos 0x0, ttl 64, id 51127, offset 0, flags [DF], proto TCP (6), length 52)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x59b4 (correct), seq 1, ack 177, win 235, options [nop,nop,TS val 176318340 ecr 14406495], length 0
07:57:41.928976 IP (tos 0x0, ttl 64, id 51128, offset 0, flags [DF], proto TCP (6), length 1455)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0x441f (correct), seq 1:1404, ack 177, win 235, options [nop,nop,TS val 176318346 ecr 14406495], length 1403
07:57:41.929020 IP (tos 0x0, ttl 64, id 21235, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x5410 (correct), seq 177, ack 1404, win 251, options [nop,nop,TS val 14406514 ecr 176318346], length 0
07:57:41.932827 IP (tos 0x0, ttl 64, id 21236, offset 0, flags [DF], proto TCP (6), length 178)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [P.], cksum 0x458d (correct), seq 177:303, ack 1404, win 251, options [nop,nop,TS val 14406515 ecr 176318346], length 126
07:57:41.933237 IP (tos 0x0, ttl 64, id 21237, offset 0, flags [DF], proto TCP (6), length 440)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [P.], cksum 0xaafd (correct), seq 303:691, ack 1404, win 251, options [nop,nop,TS val 14406515 ecr 176318346], length 388
07:57:41.934794 IP (tos 0x0, ttl 64, id 51129, offset 0, flags [DF], proto TCP (6), length 52)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x53a1 (correct), seq 1404, ack 303, win 235, options [nop,nop,TS val 176318346 ecr 14406515], length 0
07:57:41.934819 IP (tos 0x0, ttl 64, id 51130, offset 0, flags [DF], proto TCP (6), length 52)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x5215 (correct), seq 1404, ack 691, win 243, options [nop,nop,TS val 176318346 ecr 14406515], length 0
07:57:41.943821 IP (tos 0x0, ttl 64, id 51131, offset 0, flags [DF], proto TCP (6), length 310)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0x975e (correct), seq 1404:1662, ack 691, win 243, options [nop,nop,TS val 176318347 ecr 14406515], length 258
07:57:41.950135 IP (tos 0x0, ttl 64, id 51132, offset 0, flags [DF], proto TCP (6), length 645)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0x0f7f (correct), seq 1662:2255, ack 691, win 243, options [nop,nop,TS val 176318348 ecr 14406515], length 593
07:57:41.950385 IP (tos 0x0, ttl 64, id 21238, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x4e89 (correct), seq 691, ack 2255, win 294, options [nop,nop,TS val 14406520 ecr 176318347], length 0
07:57:42.095173 IP (tos 0x0, ttl 64, id 21239, offset 0, flags [DF], proto TCP (6), length 397)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [P.], cksum 0x5438 (correct), seq 691:1036, ack 2255, win 294, options [nop,nop,TS val 14406564 ecr 176318347], length 345
07:57:42.120409 IP (tos 0x0, ttl 64, id 51133, offset 0, flags [DF], proto TCP (6), length 5844)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x9ac3 (incorrect -> 0x7d42), seq 2255:8047, ack 1036, win 252, options [nop,nop,TS val 176318364 ecr 14406564], length 5792
07:57:42.120449 IP (tos 0x0, ttl 64, id 21240, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x35f1 (correct), seq 1036, ack 8047, win 385, options [nop,nop,TS val 14406571 ecr 176318364], length 0
07:57:42.124020 IP (tos 0x0, ttl 64, id 51137, offset 0, flags [DF], proto TCP (6), length 8740)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0xa613 (incorrect -> 0x0a09), seq 8047:16735, ack 1036, win 252, options [nop,nop,TS val 176318364 ecr 14406564], length 8688
07:57:42.124062 IP (tos 0x0, ttl 64, id 21241, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x1378 (correct), seq 1036, ack 16735, win 521, options [nop,nop,TS val 14406572 ecr 176318364], length 0
07:57:42.125616 IP (tos 0x0, ttl 64, id 51143, offset 0, flags [DF], proto TCP (6), length 11636)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0xb163 (incorrect -> 0x20a7), seq 16735:28319, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406571], length 11584
07:57:42.125633 IP (tos 0x0, ttl 64, id 21242, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0xe580 (correct), seq 1036, ack 28319, win 702, options [nop,nop,TS val 14406573 ecr 176318365], length 0
07:57:42.125642 IP (tos 0x0, ttl 64, id 51151, offset 0, flags [DF], proto TCP (6), length 2948)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0x8f73 (incorrect -> 0xca35), seq 28319:31215, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406572], length 2896
07:57:42.125648 IP (tos 0x0, ttl 64, id 21243, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0xda03 (correct), seq 1036, ack 31215, win 747, options [nop,nop,TS val 14406573 ecr 176318365], length 0
07:57:42.125655 IP (tos 0x0, ttl 64, id 51153, offset 0, flags [DF], proto TCP (6), length 1500)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0xdb5f (correct), seq 31215:32663, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406572], length 1448
07:57:42.127416 IP (tos 0x0, ttl 64, id 51154, offset 0, flags [DF], proto TCP (6), length 13084)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0xb70b (incorrect -> 0xb861), seq 32663:45695, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406572], length 13032
07:57:42.127439 IP (tos 0x0, ttl 64, id 21244, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0xa091 (correct), seq 1036, ack 45695, win 973, options [nop,nop,TS val 14406573 ecr 176318365], length 0
07:57:42.127453 IP (tos 0x0, ttl 64, id 51163, offset 0, flags [DF], proto TCP (6), length 2948)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0x8f73 (incorrect -> 0xa78d), seq 45695:48591, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406573], length 2896
07:57:42.127459 IP (tos 0x0, ttl 64, id 21245, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x9514 (correct), seq 1036, ack 48591, win 1018, options [nop,nop,TS val 14406573 ecr 176318365], length 0
07:57:42.127466 IP (tos 0x0, ttl 64, id 51165, offset 0, flags [DF], proto TCP (6), length 2948)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x8f73 (incorrect -> 0xd652), seq 48591:51487, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406573], length 2896
07:57:42.127470 IP (tos 0x0, ttl 64, id 21246, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x8996 (correct), seq 1036, ack 51487, win 1064, options [nop,nop,TS val 14406573 ecr 176318365], length 0
07:57:42.128832 IP (tos 0x0, ttl 64, id 51167, offset 0, flags [DF], proto TCP (6), length 7804)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [P.], cksum 0xa26b (incorrect -> 0x27e0), seq 51487:59239, ack 1036, win 252, options [nop,nop,TS val 176318365 ecr 14406573], length 7752
07:57:42.128842 IP (tos 0x0, ttl 64, id 21247, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x6ad4 (correct), seq 1036, ack 59239, win 1185, options [nop,nop,TS val 14406574 ecr 176318365], length 0
07:57:47.129976 IP (tos 0x0, ttl 64, id 21248, offset 0, flags [DF], proto TCP (6), length 83)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [P.], cksum 0x6e48 (correct), seq 1036:1067, ack 59239, win 1185, options [nop,nop,TS val 14408074 ecr 176318365], length 31
07:57:47.130042 IP (tos 0x0, ttl 64, id 21249, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [F.], cksum 0x64d8 (correct), seq 1067, ack 59239, win 1185, options [nop,nop,TS val 14408074 ecr 176318365], length 0
07:57:47.131780 IP (tos 0x0, ttl 64, id 51173, offset 0, flags [DF], proto TCP (6), length 52)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [F.], cksum 0x6c83 (correct), seq 59239, ack 1036, win 252, options [nop,nop,TS val 176318866 ecr 14406574], length 0
07:57:47.131823 IP (tos 0x0, ttl 64, id 21250, offset 0, flags [DF], proto TCP (6), length 52)
sparhawk-xps-17.lan.56880 > pi.lan.https: Flags [.], cksum 0x62e1 (correct), seq 1068, ack 59240, win 1185, options [nop,nop,TS val 14408075 ecr 176318866], length 0
07:57:47.131839 IP (tos 0x0, ttl 64, id 51174, offset 0, flags [DF], proto TCP (6), length 52)
pi.lan.https > sparhawk-xps-17.lan.56880: Flags [.], cksum 0x6687 (correct), seq 59240, ack 1068, win 252, options [nop,nop,TS val 176318866 ecr 14408074], length 0
Estou usando o Apache. Há um arquivo linkado por link em /etc/apache2/sites-enabled
com o seguinte conteúdo.
<VirtualHost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName foo.dynu.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
ServerAdmin pi@raspberrypi
DocumentRoot /var/www/
<Directory /var/www/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>