faloker / purify

All-in-one tool for managing vulnerability reports from AppSec pipelines

Home Page:https://faloker.gitbook.io/purify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

502 on backend

hazanasec opened this issue · comments

Hi Faloker,

Thank you so much for creating this project, It's a great concept and well executed. At some point soon I will make a contributution to go towards keeping it maintained.

My instance was set up through docker-compose, but has just stopped working, and it seems it's getting 502's when trying to hit the back end:

POST https://x/api/auth
[HTTP/2 502 Bad Gateway 35ms]

Request URL:https://x/api/auth
Request method:POST
Remote address:x.x.x.x:443
Status code:
502
Version:HTTP/2

and:

2020/04/30 14:47:17 [error] 9#9: *1 connect() failed (111: Connection refused) 
while connecting to upstream, client: x.x.x.x, server:x, 
request: "POST /api/auth/signup HTTP/2.0", 
upstream: "http://172.24.0.3:3000/api/auth/signup", host: "x", referrer: "https://x/"

my nginx.conf:

http {
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  '$status $body_bytes_sent "$http_referer" '
  '"$http_user_agent" "$http_x_forwarded_for"';
  access_log /var/log/nginx/access.log main;
  client_max_body_size 800m;
  sendfile on;
  keepalive_timeout 65;

  server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name x www.x;

    location / {
      root /app;
      index index.html;
      try_files $uri $uri/ /index.html;
    }

    location /api {
      proxy_pass http://api:3000;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
      root /usr/share/nginx/html;
    }

    ssl_certificate /etc/nginx/ssl/cert;
    ssl_certificate_key /etc/nginx/ssl/key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;
    ssl_session_tickets off;

    ssl_protocols TLSv1.3;
    ssl_prefer_server_ciphers off;
  }

  server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name x www.x;

    return 301 https://$server_name$request_uri;
  }
}

Thank you!