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

Cannot get content path working #11749

Closed
AndrukhivAndriy opened this issue Feb 6, 2025 · 5 comments
Closed

Cannot get content path working #11749

AndrukhivAndriy opened this issue Feb 6, 2025 · 5 comments
Labels

Comments

@AndrukhivAndriy
Copy link

I have ubuntu 24 server with docker. And i am trying deploy Defectdojo by the link https://domain.com/bugs . I did everything described - Run under a context path #6171 , but no results.
My changes:

  1. Moved Nginx from docker host. It's necessary for me as this server has other web projects. Part of nginx.conf:
    .....
    upstream uwsgi_server { server 127.0.0.1:3031; }
    location /bugs/static/ {
    alias /var/www/html/static/;
    }

location /bugs/ {

include uwsgi_params;
uwsgi_pass uwsgi_server;
uwsgi_read_timeout 1800;
......
2. Copied folder with CSS and js /static to /var/www/html
3. Changes with docker-compose:
3.1 Commented all nginx block
3.2 Added to uwsgi :
...
environment:
DD_URL_PREFIX: 'bugs'
DD_LOGIN_URL: '/bugs/login'
ports:
- "3031:3031"
3.3 Added to celerybeat, celeryworker, initializer
....
environment:
DD_URL_PREFIX: 'bugs'
DD_LOGIN_URL: '/bugs/login'

After going to https://domain.com/bugs/ -- got https://domain.com/bugs/login?next=/bugs/ link and message from Defectdojo :
Well...
...we can't find what you're looking for.
,
after link https://domain.com/bugs/login?next= --- got the same message. Could you help me to deploy Defectdojo in the right way ? Thanks

@valentijnscholten
Copy link
Member

In all these years I've seen this question from time to time, but I have never seen anyone getting it to work. As I mentioned in 6171 I believe a setting to the UWSGI daemon needs to be provided for this to work. Maybe more steps are needed that we don't know about yet. Feel free to post your addition questions in 6171, you might get more response from people participating there.

@mtesauro
Copy link
Contributor

mtesauro commented Feb 7, 2025

I agree with val 👆 - I've seen this work but it was maybe year 1 or 2 when DefectDojo was first released as open source. It's probably been 7 or 8 years since I've heard of someone successfully moving DefectDojo onto a path that isn't /

Those settings are more likely things we neglected to clean up rather then things we intended to work (or have tests to validate they actually work). If nothing else, PRs over the years probably removed that functionality as part of other code changes.

The last time I did something like this with an open source project, I ended up using sub_filter from nginx to re-write responses to fix the URL but that felt totally hacky. Something like this https://serverfault.com/a/501298

I wish you luck but you might be fighting an uphill battle.

@AndrukhivAndriy
Copy link
Author

Thank all of you for your quick reply. The problem was solved. I described the solution in the medium article. It's in Ukrainian lang, but all changes - in Eng. Link - https://medium.com/@AndriyAndrukhiv/deploying-defectdojo-via-docker-on-ubuntu-server-by-the-link-like-domain-com-dojo-6b5ed036b289?source=friends_link&sk=7317919de471c3fbb4cae66001de2561

@valentijnscholten
Copy link
Member

Thanks for sharing! Does the API also work? You may also need to set the correct value in DD_SITE_URL for notifications to use the correct url.

@AndrukhivAndriy
Copy link
Author

Yep, I forgot about API. Thanks. Just for now, I am working only with UI, and API has not been tested. I will do it later. Despite the parameter DD_SITE_URL, there is also DD_URL_PREFIX . And I do not know how they are associated with API. If I will remember - I will give comment

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

No branches or pull requests

3 participants