Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I am using docker compose to create 2 containers one for application running on Nginx and another for backend application on Nodejs(running on another port 4000) with routes of patterns “/org-metadata/, /proxy-api/, /node-api/**”.
I am trying to proxy the nginx to nodejs running on 4000, but it does not reach the backend. and the nginx gives the 502 Bad Gateway response.
P.S: my node app gives 503 service unavailable when I run it from browser.
Can some one pls point where am I missing anything?
Here is my nginx.conf file:
worker_processes auto;
events {
worker_connections 8000;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr;
upstream backend {
server 127.0.0.1:4000;
}
server {
listen 80;
root /var/www;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ~ (proxy-api|node-api|\/api\/) {
proxy_pass http://backend;
proxy_redirect off;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
}
}
}
docker-compose.yml
version: "3"
services:
nodejs:
build:
context: "./server"
ports:
- "4000:4000"
image: nodejs
container_name: nodejs
restart: unless-stopped
webserver:
build: "."
ports:
- "80:80"
image: webserver
container_name: webserver
restart: unless-stopped
depends_on:
- nodejs
Dockerfile for nodejs:
FROM node:11-alpine
WORKDIR /app
COPY . .
RUN npm ci
EXPOSE 4000
CMD [ "npm", "run", "start" ]
Dockerfile for nginx:
FROM nginx:1.15.2-alpine
COPY ./build /var/www
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
ENTRYPOINT ["nginx","-g","daemon off;"]
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
Ruz
Ruz
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e
markatango
gouskova