My puprose is to use nginx as a proxy for another application and I get an error above and I get 502 badgateway
when I try to access my app.
My nginx configurations are shown below and I already unlinked the default nginx configurations but I still get the error below in /var/log/nginx/error.log.
Any clues ?
server{
listen 80 default_server ;
listen [::]:80 default_server;
server_name pivot.staging.ippen.space;
location / {
resolver 127.0.0.53
proxy_pass https://$server_name:443/;
}
}
and when i used 127.0.0.1 / 8.8.8.8 as a resolver I get the folowing error:
nginx: [emerg] host not found in resolver "proxy_pass" in /etc/nginx/sites-enabled/custom_server.conf:9
I use nginx as a VM instance on Google cloud and I have two firewall rules (allow http and allow ssh access); OS is ubuntu 16.04.