Question

redirect www request to nginx server using gitlab ce omnibus package

Dear all,

I have the Gitlab CE installed on a ubuntu machine. I have purchased a domain that directs traffic like gitlab.mydomain.com to the ubuntu server running gitlab. Now i am going to also send every request to www.mydomain.com to the same ubuntu. I would like to configure the existing nginx in the gitlab CE to forward www request to a server running debian and nginx with ip 192.168.0.241. I already modified the gitlab.rb file to include custom nginx configuration files. But now what should this configuration include so that only www traffic in http and https are forwarded correctly? so far i have this: server { server_name www.mydomain.com; location / { proxy_pass http://192.168.0.241:80; proxy_set_header Host www.mydomain.com; } } But what about https? If this works , i suppose i have to add a redirect http to https rule also?

Thx for your advice, Didier

Show comments

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Accepted Answer

I managed to successfully forward the request by letting all request arrive on the rpi nginx and then forward the gitlab request to nginx of the omnibus package. What to remember is that you need also to copy the ssl certificates then of the gitlab server to the rpi.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.