• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Forwarded to devs [nginx] localhost can't be resolved

manuth

New Pleskian
User name: manuth

TITLE

[nginx] localhost can't be resolved

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian v18.0.25_build1800200325.19 os_Ubuntu 18.04, Ubuntu 18.04.4 LTS, x86_64

PROBLEM DESCRIPTION

proxy_pass-directives to localhost won't work.

STEPS TO REPRODUCE

Create a fresh Ubuntu 18.04.4 installation
Install plesk using the One Click Setup
Create a docker-container which publishes a port.
Create a (sub-)domain with 301-redirection to https
In the nginx & Apache options disable proxy mode
Add a piece of code like this here:
NGINX:
location / {
    proxy_pass http://localhost:8080;
}

Try to access the website with said nginx-config.

ACTUAL RESULT

An error is reported:
Code:
3777#0: *622 no resolver defined to resolve localhost

After applying the fix mentioned in this thread: Websites show 502 Bad Gateway: no resolver defined to resolve example.com

Another error is reported instead:
Code:
7707#0: *627 localhost could not be resolved (3: Host not found)

EXPECTED RESULT

The requests should be passed to localhost without an error.

ANY ADDITIONAL INFORMATION

A possible workaround is to use 127.0.0.1 instead of localhost. But after trying this I found another very weird misbehavior of plesk's nginx which is covered in a separate thread.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Last edited:
Thanks for the rapid answer
My /etc/hosts looks as followed:
Bash:
127.0.0.1       localhost.localdomain localhost
127.0.1.1       [censored]

# The following lines are desirable for IPv6 capable hosts
::1     localhost.localdomain localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
 
Back
Top