0

I have set up Gitlab using Omnibus. It has embedded nginx. It works fine on ports 80 and 443. On 8083 I also have installed VestaCP. VestaCP has Softaculous. Using Softaculous I have installed a PHP application under a subdomain. Unfortunately, when I am trying to access this subdomain I am being redirected to Gitlab (by Gitlab's nginx).

I have tried adding:

location /scheduler {
        root /home/admin/web/mydomain.tld/public_html/scheduler/;
        index index.php;
}

in /opt/gitlab/embedded/conf/nginx.conf and then running gitlab-ctl reconfigure as well as gitlab-ctl restart but it didn't work.

What do I have to do to view /home/admin/web/mydomain.tld/public_html/scheduler/index.php when I will try to access mydomain.tld/scheduler? Currently, *mydomain.tld/** is mapped by Gitlab.

3
  • I simply wouldn't do that because it can cause you problems down the road, especially when you update gitlab.
    – Broco
    Sep 30, 2018 at 16:30
  • @Broco Does it mean that I shouldn't expose anything else from my server (on default port)?
    – spam
    Sep 30, 2018 at 16:32
  • Not that, but you get all kinds of weird issues if you employ customizations to the default gitlab setup. You can expect to manually update your gitlab-nginx configuration every time you update gitlab. After half a year it annoyed me so much, my gitlab runs in a vm with its own public IP now, saved me hours of work.
    – Broco
    Sep 30, 2018 at 16:45

1 Answer 1

0

What do I have to do to view /home/admin/web/mydomain.tld/public_html/scheduler/index.php when I will try to access mydomain.tld/scheduler?

One general error I spotted in your code is the duplicate scheduler subdirectory. If your location is /scheduler/, the root should only be /home/admin/web/mydomain.tld/public_html/, as nginx will take the location and prepend it to the root.

See the nginx docs for root for more details. Maybe you also want to use alias instead.

1
  • I have removed "scheduler" from the line starting with "root" and reconfigured Gitlab. Nothing has changed (still mydomain.tld/scheduler redirects to Gitlab).
    – spam
    Sep 30, 2018 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .