Article ID: 122103, created on Jun 19, 2014, last review on Jun 19, 2014

  • Applies to:
  • Plesk 12.0 for Linux


Site opens with the 502 Bad Gateway error.

The following error can be observed in the /var/log/nginx/error.log:

[error] 20109#0: *945 no resolver defined to resolve, client:, server: , request: "GET / HTTP/1.1", host: ""

The $host is used in the /etc/nginx/plesk.conf.d/server.conf under the location instead of server IP-address:

location / {
    proxy_pass http://$host:7080; <--default is proxy_pass;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


Nginx misconfiguration, there is no resolver specified in the Nginx configuration.


In order to make configuration with $host option to work resolver should be added to /etc/nginx/nginx.conf under the http section:

# grep -C2 resolver  /etc/nginx/nginx.conf
http {
    include       mime.types;
    default_type  application/octet-stream;

Search Words


no resolver defined to resolve

29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7

Email subscription for changes to this article
Save as PDF