Report this

What is the reason for this report?

Configuring nginx to serve multiples subdomains on Gitlab dropplet

Posted on June 15, 2014

Hello,

I have set up a Gitlab dropplet which is working fine. I would like to leave gitlab on a specific subdomain and use nginx to server other websites too.

I already edited gitlab to answer on that subdomain (gitlab.example.com) but I don't know how to configure nginx to point the other ones. I could not find the standard sites-availables, sites-enabled folders.

Can you help me?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi

gitlab installer is using chef recipe to provision ngnix. You can modify those recipies as is described here:

http://stackoverflow.com/questions/24090624/using-gitlabs-nginx-to-serve-another-app/

Hi Leto,

I’ll do my best to help you but first I just need to know some more information. Why are you unable to use the standard sites-available/sites-enabled(sites-enabled is just system links to sites available btw)

You can setup a server block like this in whatever configuration file you are using to allow another domain <pre> server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.html index.htm;

server_name localhost;

location / {
    try_files $uri $uri/ =404;
}

} </pre> Hope this helps…

The GitLab one-click image uses GitLab’s “omnibus” installer. It’s designed to run in a self contained manner and installs it own libraries including Nginx under <code>/opt</code>. So you might be better off installing GitLab yourself on a clean droplet:

https://www.digitalocean.com/community/tutorials/how-to-set-up-gitlab-as-your-very-own-private-github-clone

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.