Nginx is downloading a file instead of doing a proxy pass

Hello, I am new in the self hosting world and am trying to learn how to use nginx as a reverse proxy. The issue that I am running into is that when I try to type in the domain name or the ip address, instead of bringing me to the correct port it just downloads a file that all it has is a bunch of spaces with 's, €'s, and ÿ's. Does anybody know what would cause this? My friend was the one that was teaching me how to use it and my conf file is exactly the same as his but mine doesn't work.

right now my file looks like this :

server {
listen 80 http2;
server_name pihole.home.local;

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:6783/;
}
}

the proxy pass is for pihole that I have put on port 6783. I've tried googling around and I have zero idea what would cause this or how to fix it.

any help is appreciated!

5 thoughts on “Nginx is downloading a file instead of doing a proxy pass”

  1. just to make sure I didn’t miss a step somewhere, I downloaded nginx and then went straight into /etc/nginx/sites-enabled and made this conf file. Then I go to my web browser and enter [http://pihole.home.local](http://pihole.home.local) and all it does is download a file called download and when I go into the file properties and it says it’s a file of type file. When I open it in notepad it has the ’s, €’s, and ÿ’s. When I open it in visual studio, it looks like it’s hexidecimal, but then when I put it in a translator it just translates to nonsense. Everything I found online of nginx downloading a file was related to doing a fastcgi\_pass instead of proxy\_pass so I’m at a loss of what to do

    Reply

Leave a Comment