• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

502 Error on Creating Subdomain

S_Webb

New Pleskian
I adapted the example on this page for adding subdomains with this packet:

Code:
<packet version='1.5.2.0'>
<subdomain>
 <add>
   <parent>someurl.com</parent>
   <name>$username</name>
   <property>
      <name>www_root</name>
      <value>/path/to/here/$username</value>
   </property>
   <property>
      <name>ftp_login</name>
      <value>********</value>
   </property>
   <property>
      <name>ftp_password</name>
      <value>********</value>
   </property>
 </add>
</subdomain>
</packet>

When the code runs, the subdomain is created, but it returns with a 502 Bad Gateway (nginx) error. I tried looking through the error logs, but found nothing that seemed to be connected with that.

Do you have any suggestions on what I could do? Any help would be greatly appreciated.

Edit: I just found an interesting error in /var/log/nginx/error.log

Code:
2013/04/24 13:36:43 [error] 12258#0: *417 upstream prematurely closed connection while reading response header from upstream, client: **.**.***.***, server: ****.com, request: "GET /test_subdomain.php HTTP/1.1", upstream: "http://***.***.***.***:7080/test_subdomain.php", host: "*****.com"

2013/04/24 13:36:52 [error] 12258#0: *417 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: **.**.**.***, server: ****.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://***.***.***.***:7080/favicon.ico", host: "****.com"

Though I am not really sure what that means needs to happen...
 
Last edited:
I worked it out on my own, but am posting what worked for me in case anyone with the same problem stumbles on this thread.

I found out that Apache restarts when a subdomain is created. That causes an interruption for nginx. There are two solutions for this.

1) Create the subdomains from another server.
2) Increase the Apache restart interval. You can do that by running this in ssh:
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -e "update misc set val = '60' where param = 'restart_apache_interval'"

At least that is my best understanding of what is going on.
 
Back
Top