upstream mongodb { server 83.212.77.66:28017; server 83.212.77.74:28017; server 83.212.77.49:28017; } proxy_cache_path /var/tmp levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m use_temp_path=off; server { listen 80; listen [::]:80; server_name mongodb.example.org$request_uri; location / { return 301 https://83.212.77.66; } } } server { listen 443 default_server; listen [::]:443 http2 ssl default_server; server_name nginx; # Your favorite resolver may be used instead of the Google one below resolver 8.8.4.4 8.8.8.8 valid=300s; resolver_timeout 10s; root /var/www; index index.html; location /nginx-status { default_type application/json; return 200 '{"code":"1", "message": "Healthcheck OK"}'; } location ~^/(contacts|app-back-status) { proxy_pass http://app-back:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }