title: Setup nginx in docker. Want to send request from docker backend container to internet
body: <p>I have a backend container in internal docker network, which is not accessible to the internet.</p>
  <p>Through nginx proxy i want to send request (webhook to slack) from backend server to outside world. Is it possible at all?</p>
  <p>I have this config for nginx:</p>
  <pre><code>server {
  listen 80 default_server;
  
  server_name localhost;
  
  client_max_body_size 100M;
  charset utf-8;
  
  ... # setup for server containers
  }
  
  server{
    listen 443;
    server_name hooks.slack.com;
  
    location / {
      proxy_pass            https://hooks.slack.com/;
      proxy_redirect        off;
      proxy_set_header      Host $http_host;
      #proxy_set_header      X-Real-IP $remote_addr;
      proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for; #Gets CSS working
      #proxy_set_header      X-Forwarded-Host $server_name;
      proxy_set_header      X-Forwarded-Proto $scheme;
    }
  }
  </code></pre>