JBEI/edd

Welcome to NGINX

Closed this issue · 8 comments

Hello. I am trying to deploy my own instance of EDD within a development environment. I believe I am following the steps correctly in the docs, but navigating to the hostname within my browser only takes me to the nginx splash page stating the following:`

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.

Thank you for using nginx.

Is there something I may have missed in the configuration that is causing only this page to be reachable? I am very new to all this so thank you for your time and patience.

It's hard to say without seeing your configuration. Do you already have nginx running on the development host? Are all the containers shown as running and healthy in the output of docker ps? Are you setting the VIRTUAL_HOST environment of the edd container to the same hostname as what you are using to access via browser?

The host is a freshly made Amazon EC2 so there was no previously running nginx. All the containers appear to be running healthy. With regards to the VIRTUAL_HOST environment, I was a little unsure where to change that. I am running this off the EC2 and am just entering its private IP in the URL field to navigate to the page. This acts more or less like a localhost IP as far as I know.

Using an IP address will not work, nginx proxies to the backend container services via hostname only. For development purposes you should be OK by modifying your /etc/hosts locally to have an entry mapping a hostname to the EC2 address, then put that hostname in the VIRTUAL_HOST environment setting.

Ah thank you! I will go ahead and try this. I am sorry to ask what I am sure is not a great question, but there appear to be a lot of VIRTUAL_HOST environment variables. Which specific file’s variable should I actually be changing for this? Thanks again for your help!

In the generated docker-compose.override.yml file, under the edd service definition and the websocket service definition (the latter so WebSocket notifications will work correctly). Add VIRTUAL_HOST with a distinct hostname to any other else that speaks HTTP and you want to access via browser (Solr, RabbitMQ management app, etc).

Hi there. I am sorry to bother once again with this issue, but I followed your instructions and still have the same issue. There is some improvement in that now when I enter my specified hostname, I am directed to the nginx splash page. The issue is that I am still encountering the splash page. This is my code for the docker-compose.override.yml file:

# Uncomment below to run EDD in debug mode
      #EDD_DEBUG: "true"

      # Set these variables to control proxy through nginx
      # NOTE: IP addresses not accepted for VIRTUAL_HOST. For local testing, create an entry in
      # /etc/hosts, e.g. 192.168.99.100 local-development, then add the host name you chose to
      # ALLOWED_HOSTS in your local.py
      VIRTUAL_HOST: "ceotest.me.com"
      VIRTUAL_PORT: "8000"
      VIRTUAL_STATIC: "true"
      # If doing local-only testing, no certificates are generated, and nginx will not listen on
      #   port 443; set the HTTPS_METHOD to "noredirect" to access via port 80 without automatic
      #   redirect to 443
      HTTPS_METHOD: "noredirect"
      #LETSENCRYPT_HOST: edd.example.net
      #LETSENCRYPT_EMAIL: "aliddell@example.net"
      # The below line directs to use staging Let's Encrypt server. It is commented out by
      #   default, but should be enabled while troubleshooting any errors getting a certificate.
      #   Troubleshooting against the production Let's Encrypt server is likely to hit rate
      #   limits; see <https://letsencrypt.org/docs/staging-environment/>.
      #LETSENCRYPT_TEST: "TRUE"

    # Add in the 'proxynet' network if using the nginx/docker-gen/letsencrypt containers
    networks:
      - proxynet

The same settings for environment variables are true in websocket as well. My /etc/hosts file is also properly edited, just to clarify. Thank you for any help you can offer in solving this issue. I really appreciate your patience.

P.S.: I thought it was worth noting that the status for my nginx main container remains as (health: starting). I am not sure what this implies but I have been trying to find solutions for it and it seems abnormal.

Oddly enough, simply restarting only the nginx main container solved the issue. Your help has been extremely appreciated, thanks!!

The nginx issue of remaining in starting condition indefinitely, unless the container is restarted, is a known problem. There is a fix pending. As far as I can figure, there is something about sending a reload signal to nginx before the first healthcheck from Docker is run, that causes healthchecks to never run.