0

I've set up a general http to https redirect in my ubuntu virtual host file as shown below:

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
    #UseCanonicalName Off
    #ServerName test.example.com
    #ServerAdmin webmaster@localhost
    #DocumentRoot /var/www/test.example.com/web
    RewriteEngine on
    ReWriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>

<VirtualHost *:443>
    UseCanonicalName Off
    ServerName test.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/test.example.com/web
    SSLEngine on
    SSLCertificateFile /etc/ssl/bcerts/b.crt
    SSLCertificateKeyFile /etc/ssl/bcerts/b.key
    SSLCertificateChainFile /etc/ssl/bcerts/b.ca-bundle
</VirtualHost>

The above confirguration works fine except I have http POST requests that aren't SSL coming from an iOS app that get converted into http GET requests (presumably because a 302 request will always do this). However, I need the apache config to allow for http POST requests to remain http POST requests without changing the iOS app code. Any configuration that allows this?

  • It's not as if Apache is stripping anything. The redirection is done by the browser and the browser must send the data again to the new URL. I might be wrong but I don't think there's nothing like that in the HTTP standards. – Álvaro González Jun 14 '13 at 11:44
  • This is serverfault.com – Michael-O Jun 14 '13 at 12:33

0 Answers0