0

Using

apache2ctl -t -D DUMP_VHOSTS

shows

VirtualHost configuration:
*:443                  is a NameVirtualHost
     default server api.mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:3)
     port 443 namevhost api.mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:3)
             wild alias *api.mysite.com
     port 443 namevhost testapi.mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:70)
             wild alias *testapi.mysite.com
     port 443 namevhost admin.mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:146)
             wild alias *admin.mysite.com
     port 443 namevhost beta.mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:179)
             wild alias *beta.mysite.com
     port 443 namevhost mysite.com (/etc/apache2/sites-enabled/mysite-ssl.conf:217)
             wild alias *.mysite.com

mysite.com and beta have Directory's and work fine. admin is only a proxy pass in a Location block and works fine. These three are page url's. api and testapi are proxy passes with no Directory, only Location. All 443 are in the same file under VirtualHost *:443.

<VirtualHost *:443>
  ServerAdmin [email protected]
  ServerName testapi.mysite.com
  ServerAlias *testapi.mysite.com

  SSLEngine on
  SSLProtocol all -SSLv2 -TLSv1
  SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

  SSLCertificateFile /etc/apache2/ssl/acc6af27250e2edc.crt
  SSLCertificateKeyFile /etc/apache2/ssl/mysite.key
  SSLCertificateChainFile /etc/apache2/ssl/gd_bundle-g2-g1.crt

  <Location />
    ProxyPass http://localhost:8889/
    ProxyPassReverse http://localhost:8889/
  </Location>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

https POST requests to testapi do not even show in Apache's access log. 404 Not Found.

This is a translation from an Nginx configuration that does work. I'd like to see it in Apache.

Any idea why a POST request might not connect?

1 Answer 1

0

Resolved. The above does work. I thought Location / was the culprit, or possibly something I ignored to add in the config. What I actually had was

<Location /another-path>
    ProxyPass http://localhost:3003/another-path
    ProxyPassReverse http://localhost:3003/another-path
</Location>

above the generic location. The request to another-path was falling through and attempting a path that did not exist on the wrong upstream. The logs were no help. Obviously, I should have included the full config in the question.

The order is important, of course. Location /another-path, below the generic (/) worked. This had been the opposite in Nginx.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .