Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://my-dev-env.local serving pages from both django and docs containers #2840

Open
SeraphimSG opened this issue Sep 18, 2020 · 6 comments · May be fixed by #3111
Open

https://my-dev-env.local serving pages from both django and docs containers #2840

SeraphimSG opened this issue Sep 18, 2020 · 6 comments · May be fixed by #3111
Labels

Comments

@SeraphimSG
Copy link

SeraphimSG commented Sep 18, 2020

What happened?

After implementing the steps described under the "Developing locally with HTTPS" section of the docs, https://my-dev-env.local served pages randomly from both the django and docs containers, resulting in returning successful pages (200) at times and returning 404 page not found errors at other times.

What should've happened instead?

https://my-dev-env.local should only serve pages from the django container.

Additional details

From my observations, this is due to both django and docs containers being included within the "upstream" section of the generated nginx-proxy '/etc/nginx/conf.d/default.conf' file.

This is in turn caused by both django: and docs: within local.yml pointing to the same .env file (/.envs/.local/.django). Hence when VIRTUAL_HOST and VIRTUAL_PORT are added to this .env file (as instructed in the docs), they ended up linking nginx-proxy to both django and docs containers.

As a workaround, I simply created a /.envs/.local/.docs, pointed to this new env file in local.yml (under docs:), rebuilt the containers, and https://my-dev-env.local is serving everything properly now.

I'm wondering if there's a more elegant way around this or is there something I may have missed out in my set up?

  • Host system configuration:
    • Version of cookiecutter CLI (get it with cookiecutter --version): 1.7.2
    • OS: MacOS 10.15.6
    • Python version: 3.8.5
    • Docker versions (if using Docker): 19.03.12
@SeraphimSG SeraphimSG added the bug label Sep 18, 2020
@SeraphimSG SeraphimSG changed the title [bug] https://my-dev-env.local serving pages from both django and docs containers Sep 18, 2020
@asencis
Copy link

asencis commented Feb 18, 2021

I can confirm that I am also seeing this issue.

@asencis
Copy link

asencis commented Feb 18, 2021

The "fix" for me was to temporarily remove flower and docs from the local.yml file.

@browniebroke
Copy link
Member

@Afrowave this bug report relates to a part you contributed in the documentation (#2664).

I don't really use this extension and therefore I'm not really familiar with how to fix it. Since it's not really part of the template, it's a page which very likely to get outdated, therefore I'm edging on the side of removing it from our documentation. If you want to turn it into a blog post, we could link to it instead.

Let me know what you think.

@asencis
Copy link

asencis commented Feb 26, 2021

Would it not be possible to add django-sslserver as an option? I've never had it fail on me yet ... https://github.com/teddziuba/django-sslserver

However, adding this package would require dropping uvicorn, which wouldn't be compatible with an async server.

@Afrowave
Copy link
Contributor

Hey @browniebroke,

Let me fix this and give both options.

@linusthe3rd
Copy link

django and docs are both loading because they both use .envs/.local/.django, which confuses the nginx environment variable configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants