aws-samples / eb-docker-nginx-proxy

Apache License 2.0
145 stars 81 forks source link

Reconfigure for multiple golang apps? #6

Open dbvrac opened 7 years ago

dbvrac commented 7 years ago

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;

    }

}`

dbvrac commented 7 years ago

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.

InternetPseudonym commented 7 years ago

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