简体   繁体   English

通过https的PHP肥皂API调用不起作用

[英]php soap api call over https not working

I have a php soap server api setup on debian with nginx as proxy to apache. 我在Debian上使用Nginx作为Apache的代理安装了php soap服务器api。 Soap call works fine over http but not over https 肥皂调用可以在http上正常工作,但不能通过https正常

nginx configuration is as follows 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;
  }
}

and apache configuration is as follows 和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>

I have changed apache ports.conf as follows 我已经如下更改了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>

please advice what did I missed here. 请指教我在这里错过了什么。 when I use php client in my local and make a soap call it works if the url is http but does not works if the url is https I don't see any helpful error messages also. 当我在本地使用php客户端并进行Soap调用时,如果URL是http,则可以使用,但是如果URL是https,则不能使用,我也看不到任何有用的错误消息。

Your certificate for your domain is not going to be valid for localhost so Nginx will reject it. 您网域的证书对本地主机无效,因此Nginx将拒绝该证书。 You don't need SSL when connecting to localhost anyway so just make the HTTPS listener of Nginx proxy to the HTTP listener of Apache. 无论如何,在连接到本地主机时都不需要SSL,因此只需将Nginx代理的HTTPS侦听器设置为Apache的HTTP侦听器即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM