"502 bad gateway” in Nginx

Viewed 40
Hi
my problem is that I have 502 error when trying to connect to localhost:8090. 
Setup is made on running Docker container with Mariadb (MySql) in it. 
Ports: 80 and 8080 work great. Database is running (Alpine Linux - Mariadb). Localhost on port 80 and 8080 shows what should show.

I haven't had anything to do with nginx configuration before.
  1. In Error log I have this:

2022/08/04 20:55:53 [emerg] 302#302: open() "/conf/nginx/nginx.conf" failed (2: No such file or directory)

  1. In conf file:

user root; worker_processes 2; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; include /etc/nginx/sites-enabled/*; } daemon off;

  1. In sites-enabled: server { listen 8090; root /usr/bin; server_name localhost; access_log /dev/null; error_log /dev/null;

     location / {
             proxy_pass http://127.0.0.0:7001;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection 'upgrade';
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Fowarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Fowarded-Proto $scheme;
             proxy_cache_bypass $http_upgrade;
    
            try_files $uri $uri/ =404;
     }
    
     location ~ \.(gif) {
             root /var/lib;
     }
    

What should I do?

0 Answers
Related