making urls for django and gitlab CI

Posted August 30, 2017 2.1k views
GitDjangoUbuntu 16.04

I have a droplet in Digitalocean where I installed gitlab CI

The problem is that every domain I create it redirects to gitlab page

How can I make only 1 url that takes to gitlab ci and one for django?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Sorry to see that your question hasn’t received an answer yet. Unfortunately, without more information, it is unlikely that an answer for this specific issue can be provided. Generally, you would need to configure this at the web server (e.g. Apache or Nginx) level. For example, if you were using Nginx, you could create two separate server blocks to direct requests to the right app. Learn more about Nginx server blocks in this tutorial:

One important thing to note is that if you installed GitLab using their omnibus packages, they bundle a Nginx installation of their own which must be configured in /etc/gitlab/gitlab.rb

The simplest way to add a new server block is to add a custom include directive. This will allow you to set up a separate Nginx config file for the Django project. In /etc/gitlab/gitlab.rb add:

nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"

You can now create a server block for your main site in the /etc/nginx/conf.d/ directory. You can also disable the bundled Nginx all together and install the distro version if you want by adding:

nginx['enable'] = false

See here for more information on inserting custom settings into GitLab’s Nginx config.

by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.