DEV Community

Discussion on: Nginx: Everything about proxy_pass

 
iampeters profile image
Peters Chikezie • Edited

Hi Daniel,

Here is how the site looks

upstream backend {
 server 192.168.34.23:3000;
}
server {
        listen 5000 default_server;
        listen [::]:5000 default_server;

        root /var/www/html;
        index index.html index.htm index.nginx-debian.html;

        server_name http://example.com;

         location / {
                proxy_pass http://backend/;
                try_files $uri $uri/ =404;
        }
}
Thread Thread
 
iampeters profile image
Peters Chikezie

i am thinking, could the root there be the problem?

Thread Thread
 
iampeters profile image
Peters Chikezie

I have removed it and it's still the same thing.

Thread Thread
 
iampeters profile image
Peters Chikezie • Edited

Hi again Daniel,

I have been able to solve it.

I had to comment this line in the location

location / {
                proxy_pass http://backend/;
                #try_files $uri $uri/ =404;
        }

Thanks for your time. It's really appreciated