0

This just started being a problem (likely after a software upgrade?). The relevant config bits are:

<VirtualHost *:80>
    ServerAdmin webmaster@singpolyma.net
    ServerName singpolyma.net
    ServerAlias www.singpolyma.net
    RewriteEngine on
    RewriteRule ^/(.*) https://singpolyma.net/$1 [R=301,L]
</VirtualHost>

<VirtualHost 184.107.182.218:443>
    GnuTLSEnable on
    GnuTLSPriorities NORMAL
    GnuTLSCertificateFile /etc/ssl/certs/singpolyma.net2013.crt
    GnuTLSKeyFile /etc/ssl/certs/singpolyma.net2013.key

From everywhere that is not the local box, this works as expected. When I try to connect from the box itself, I get apaching replying on 443 on that IP with non-HTTPS. When I run curl with --interface and ask it to use a different interface than the one that hosts that IP, then it also works fine, even on the box.

So something strange is happening, just when I do a local request.

singpolyma
  • 489
  • 2
  • 7
  • 19

1 Answers1

4

In your https virtual host, you specified an IP address to listen for connections on. Thus, requests which connect to any other IP address on the host will never match that virtual host.

If you really wanted to do this, you could add a second IP address to the <VirtualHost> declaration, or just make it a wildcard *:443.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940