【发布时间】:2016-03-28 15:03:23
【问题描述】:
我在 debian 上设置了一个 php soap 服务器 api,并使用 nginx 作为 apache 的代理。 Soap 调用在 http 上可以正常工作,但在 https 上不行
nginx配置如下
server {
listen 443 ssl;
server_name <sub domain name>;
ssl on;
ssl_certificate /etc/nginx/ssl/dev/wildcard.<dm name>-chained.crt;
ssl_certificate_key /etc/nginx/ssl/dev/wildcard.<dm name>.key;
location / {
proxy_redirect off;
proxy_pass https://localhost:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
# return 301 https://$host$request_uri;
server_name <sub domain name>;
location / {
proxy_pass http://<server ip>:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
和apache的配置如下
<VirtualHost *:8081>
ServerName <my sub domain>
ServerAlias www.<my sub domain>
SSLEngine on
SSLCertificateFile /etc/nginx/ssl/dev/wildcard.<dm name>-chained.crt
SSLCertificateKeyFile /etc/nginx/ssl/dev/wildcard.<dm name>.net.key
#SSLProtocol ALL -SSLv2 -SSLv3
#SSLVerifyClient none
#SSLVerifyDepth 1
#SSLHonorCipherOrder On
#SSLCipherSuite
DocumentRoot /var/www/<project folder>
<Directory /var/www/<project folder>>
Options FollowSymLinks -Indexes
AllowOverride All
Order Allow,Deny
Allow from all
SSLRequireSSL
</Directory>
</VirtualHost>
我已将 apache ports.conf 更改如下
NameVirtualHost *:8080
Listen 8080
<IfModule mod_ssl.c>
NameVirtualHost *:8081
# # If you add NameVirtualHost *:443 here, you will also have to change
# # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# # to <VirtualHost *:443>
# # Server Name Indication for SSL named virtual hosts is currently not
# # supported by MSIE on Windows XP.
Listen 8081
</IfModule>
<IfModule mod_gnutls.c>
Listen 8081
</IfModule>
请告知我在这里错过了什么。 当我在本地使用php客户端并进行soap调用时,如果url是http,它可以工作,但如果url是https,它就不起作用 我也没有看到任何有用的错误消息。
【问题讨论】:
标签: php apache web-services soap nginx