{"action":"created","issue":{"url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/232","labels_url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/232/comments","events_url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/232/events","html_url":"https://github.com/sameersbn/docker-gitlab/issues/232","id":53579222,"number":232,"title":"Differentiate nginx host and port from external ones","user":{"login":"StreakyCobra","id":1587877,"avatar_url":"https://avatars.githubusercontent.com/u/1587877?v=3","gravatar_id":"","url":"https://api.github.com/users/StreakyCobra","html_url":"https://github.com/StreakyCobra","followers_url":"https://api.github.com/users/StreakyCobra/followers","following_url":"https://api.github.com/users/StreakyCobra/following{/other_user}","gists_url":"https://api.github.com/users/StreakyCobra/gists{/gist_id}","starred_url":"https://api.github.com/users/StreakyCobra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StreakyCobra/subscriptions","organizations_url":"https://api.github.com/users/StreakyCobra/orgs","repos_url":"https://api.github.com/users/StreakyCobra/repos","events_url":"https://api.github.com/users/StreakyCobra/events{/privacy}","received_events_url":"https://api.github.com/users/StreakyCobra/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-06T23:50:06Z","updated_at":"2015-01-07T10:17:40Z","closed_at":"2015-01-07T10:17:40Z","body":"Hello,\r\n\r\nFor some external reasons, I *must* use the following configuration:\r\n\r\nI have one virtual machine running `apache` which is listening on port 443. This port is the only one open to the outside. This same VM is running `docker-gitlab`, and sadly it can not directly run on port 443 because `apache` is already listening on this one. Also I can not remove `apache` because it is dispatching request localy regarding to relative urls (`/git` -> docker-gitlab, `/wiki` -> dokuwiki) and serve as HTTPS proxy for all those services. And finally I can not run docker-gitlab on another virtual machine.\r\n\r\nSo my current solution is to run docker gitlab locally on HTTP (port 10080), and configure `apache` to proxy `/git` to this port (notice to make it work I have set `GITLAB_RELATIVE_URL_ROOT=/git`):\r\n\r\n            ProxyPass /git http://0.0.0.0:10080/git\r\n            ProxyPassReverse /git http://0.0.0.0:10080/git\r\n\r\nIt is a dirty solution, and even not working always correctly: `gitlab` is still thinking that he is serving on port 10080, so all links he is sending via mail, or content loaded via ajax requests are still refering to this port, which is not accessible.\r\n\r\nIt seems possible to correct this behaviour according to this answer [1], especially the **step 3**. I could probably manage to cobble something manually on my server, but it would be far better to have a configuration parameter for this. Sadly my docker-fu is not yet sufficient to propose you a patch.\r\n\r\nIn my mind the solution looks something like this:\r\n\r\n* `GITLAB_HOST` and `GITLAB_PORT` specifying host and port served by nginx.\r\n* `EXTERNAL_HOST` and `EXTERNAL_PORT` specifying host and port served by gitlab (e.g. to generate URLs). If not specified, they should be the same as nginx ones.\r\n\r\nIt doesn't *seems* very difficult to implement, at least for what I saw on Server Fault. Also this separation between **nginx's** host and port and **external** ones would probably solve some other network architecture problems.\r\n\r\n[1] http://serverfault.com/a/630298\r\n\r\nBTW thanks for all your amazing work :+1:"},"comment":{"url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/comments/69002740","html_url":"https://github.com/sameersbn/docker-gitlab/issues/232#issuecomment-69002740","issue_url":"https://api.github.com/repos/sameersbn/docker-gitlab/issues/232","id":69002740,"user":{"login":"StreakyCobra","id":1587877,"avatar_url":"https://avatars.githubusercontent.com/u/1587877?v=3","gravatar_id":"","url":"https://api.github.com/users/StreakyCobra","html_url":"https://github.com/StreakyCobra","followers_url":"https://api.github.com/users/StreakyCobra/followers","following_url":"https://api.github.com/users/StreakyCobra/following{/other_user}","gists_url":"https://api.github.com/users/StreakyCobra/gists{/gist_id}","starred_url":"https://api.github.com/users/StreakyCobra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StreakyCobra/subscriptions","organizations_url":"https://api.github.com/users/StreakyCobra/orgs","repos_url":"https://api.github.com/users/StreakyCobra/repos","events_url":"https://api.github.com/users/StreakyCobra/events{/privacy}","received_events_url":"https://api.github.com/users/StreakyCobra/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T10:17:40Z","updated_at":"2015-01-07T10:17:40Z","body":"Oh, my bad. I was thinking that `GITLAB_PORT` was setting the listening port, but it is the `-p 10080:80` only that set it… All this make sense actually :neutral_face:\r\n\r\nSadly I can neither create subdomains, so continuing with relative url.\r\n\r\nThanks very much for your explanations! Closing the issue then."}}