我在我的ubuntu虚拟主机文件中设置了一般http到https重定向,如下所示:
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>
上述确认工作正常,但我的http POST请求不是来自iOS应用程序的SSL转换为http GET请求(可能是因为302请求将始终执行此操作)。但是,我需要apache配置允许http POST请求保留http POST请求而不更改iOS应用程序代码。任何允许这个的配置?