php soap api调用https无效

时间:2016-03-28 15:03:23

标签: php apache web-services soap nginx

我在debian上安装了php soap server api,nginx作为apache的代理。 肥皂通过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客户端并进行肥皂调用时,如果网址为http,则无效,但如果网址为https则无效 我也没有看到任何有用的错误消息。

1 个答案:

答案 0 :(得分:0)

您的域名证书对localhost无效,因此Nginx会拒绝该证书。无论如何,在连接到localhost时都不需要SSL,所以只需将Nginx代理的HTTPS侦听器设置为Apache的HTTP侦听器。