aws-samples/eb-docker-nginx-proxy

Reconfigure for multiple golang apps?

dbvrac opened this issue · 2 comments

What do I need to change in order to use a golang app? I will eventually have several apps, running on different ports, each with their own "location /SomeOtherPage" entries. Changing conf.d/default.conf to this doesn't seem to work:

`server {
listen 80;
server_name localhost;

location / {
    proxy_pass          http://127.0.0.1:5001;
    proxy_http_version  1.1;
    proxy_set_header    Connection          $connection_upgrade;
    proxy_set_header    Upgrade             $http_upgrade;
    proxy_set_header    Host                $host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;

    }

}`

Figured it out.
I needed to make a "links" entry with the name of my app in Dockerrun.aws.json, then use that app name instead of "127.0.0.1" in the above .conf file.

  • Cheers!

links are deprecated and will be removed sometime, you should switch to something else ... like environment cfg links, for example