Can Traefik maintain a path prefix if a backend redirects a request, when routing to that backend with...
2×2×2 rubik's cube corner is twisted!
Is Gradient Descent central to every optimizer?
How much stiffer are 23c tires over 28c?
The bar has been raised
Who deserves to be first and second author? PhD student who collected data, research associate who wrote the paper or supervisor?
Is there any way to damage Intellect Devourer(s) when already within a creature's skull?
BitNot does not flip bits in the way I expected
Make a transparent 448*448 image
Is there an equal sign with wider gap?
They call me Inspector Morse
Should I take out a loan for a friend to invest on my behalf?
What is the chance of making a successful appeal to dismissal decision from a PhD program after failing the qualifying exam in the 2nd attempt?
Aliens englobed the Solar System: will we notice?
Should QA ask requirements to developers?
Unreachable code, but reachable with exception
What does a stand alone "T" index value do?
Does splitting a potentially monolithic application into several smaller ones help prevent bugs?
Force user to remove USB token
How to pass a string to a command that expects a file?
Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?
Replacing Windows 7 security updates with anti-virus?
infinitive telling the purpose
"One can do his homework in the library"
PTIJ: Why can't I eat anything?
Can Traefik maintain a path prefix if a backend redirects a request, when routing to that backend with PathPrefixStrip?
Need a software load balancer that can match URL patterns for traffic routingHow can I know that an HTTP response is a response to HEAD request?can apache “fetch and return” 302/301 redirects when proxying?Using curl to request URL that redirects to relative URL with anchor tagHow to specify GET path when sending web request to an IP with cURL?Is it possible to set SSL/TLS version HTTP header with Apache which an backend application can use?Can mod_rewrite [P]roxy to an HTTPS url when the inbound request URL is HTTP?How to pass GeoIP HTTP request headers to backend with Apache?How can I intercept http requests, respond immediately with a custom http response, and also forward the original http request to the server?nginx can open with path / but can not with a different path on server
I am attempting to use Traefik as a proxy to send traffic to gitlab review environments. Gitlab CI can start docker containers to run a review version of a project. I can get Traefik to detect these containers, and route trafic to them with this kind of config in my docker-compose file:
- traefik.gitlab.frontend.rule=Host:gitlab.example.local;PathPrefixStrip:/review/$CI_BUILD_REF_NAME.$CI_PROJECT_NAME.$CI_PROJECT_NAMESPACE
- traefik.gitlab.port=80
With this I can open "https://gitlab.example.local/review/master.project.user/ping", and get my PONG page. But if I go to "https://gitlab.example.local/review/master.project.user/", the simple test app I am using will return a 303 redirect to /ping which ends up as "https://gitlab.example.local/ping", and is not proxied to the review app.
> GET /review/master.10112.root HTTP/2
> Host: gitlab.example.local
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 303
< content-type: text/html; charset=utf-8
< date: Mon, 25 Feb 2019 08:25:44 GMT
< location: /ping
< content-length: 32
<
<a href="/ping">See Other</a>.
The documentation mentions a "X-Forwarded-Prefix" header being set. I'm not sure if it is actually set. I cant see this in a curl -V. Is it the case that I need to have an app that detects this header and prepends it as a "base path" to its responses? Is there a way to configure Traefik to add this to the returning path?
Are there any other more configurable Docker aware proxies out there that I could use to route traffic to dynamically addressed gitlab review environments?
proxy docker http gitlab
add a comment |
I am attempting to use Traefik as a proxy to send traffic to gitlab review environments. Gitlab CI can start docker containers to run a review version of a project. I can get Traefik to detect these containers, and route trafic to them with this kind of config in my docker-compose file:
- traefik.gitlab.frontend.rule=Host:gitlab.example.local;PathPrefixStrip:/review/$CI_BUILD_REF_NAME.$CI_PROJECT_NAME.$CI_PROJECT_NAMESPACE
- traefik.gitlab.port=80
With this I can open "https://gitlab.example.local/review/master.project.user/ping", and get my PONG page. But if I go to "https://gitlab.example.local/review/master.project.user/", the simple test app I am using will return a 303 redirect to /ping which ends up as "https://gitlab.example.local/ping", and is not proxied to the review app.
> GET /review/master.10112.root HTTP/2
> Host: gitlab.example.local
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 303
< content-type: text/html; charset=utf-8
< date: Mon, 25 Feb 2019 08:25:44 GMT
< location: /ping
< content-length: 32
<
<a href="/ping">See Other</a>.
The documentation mentions a "X-Forwarded-Prefix" header being set. I'm not sure if it is actually set. I cant see this in a curl -V. Is it the case that I need to have an app that detects this header and prepends it as a "base path" to its responses? Is there a way to configure Traefik to add this to the returning path?
Are there any other more configurable Docker aware proxies out there that I could use to route traffic to dynamically addressed gitlab review environments?
proxy docker http gitlab
add a comment |
I am attempting to use Traefik as a proxy to send traffic to gitlab review environments. Gitlab CI can start docker containers to run a review version of a project. I can get Traefik to detect these containers, and route trafic to them with this kind of config in my docker-compose file:
- traefik.gitlab.frontend.rule=Host:gitlab.example.local;PathPrefixStrip:/review/$CI_BUILD_REF_NAME.$CI_PROJECT_NAME.$CI_PROJECT_NAMESPACE
- traefik.gitlab.port=80
With this I can open "https://gitlab.example.local/review/master.project.user/ping", and get my PONG page. But if I go to "https://gitlab.example.local/review/master.project.user/", the simple test app I am using will return a 303 redirect to /ping which ends up as "https://gitlab.example.local/ping", and is not proxied to the review app.
> GET /review/master.10112.root HTTP/2
> Host: gitlab.example.local
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 303
< content-type: text/html; charset=utf-8
< date: Mon, 25 Feb 2019 08:25:44 GMT
< location: /ping
< content-length: 32
<
<a href="/ping">See Other</a>.
The documentation mentions a "X-Forwarded-Prefix" header being set. I'm not sure if it is actually set. I cant see this in a curl -V. Is it the case that I need to have an app that detects this header and prepends it as a "base path" to its responses? Is there a way to configure Traefik to add this to the returning path?
Are there any other more configurable Docker aware proxies out there that I could use to route traffic to dynamically addressed gitlab review environments?
proxy docker http gitlab
I am attempting to use Traefik as a proxy to send traffic to gitlab review environments. Gitlab CI can start docker containers to run a review version of a project. I can get Traefik to detect these containers, and route trafic to them with this kind of config in my docker-compose file:
- traefik.gitlab.frontend.rule=Host:gitlab.example.local;PathPrefixStrip:/review/$CI_BUILD_REF_NAME.$CI_PROJECT_NAME.$CI_PROJECT_NAMESPACE
- traefik.gitlab.port=80
With this I can open "https://gitlab.example.local/review/master.project.user/ping", and get my PONG page. But if I go to "https://gitlab.example.local/review/master.project.user/", the simple test app I am using will return a 303 redirect to /ping which ends up as "https://gitlab.example.local/ping", and is not proxied to the review app.
> GET /review/master.10112.root HTTP/2
> Host: gitlab.example.local
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 303
< content-type: text/html; charset=utf-8
< date: Mon, 25 Feb 2019 08:25:44 GMT
< location: /ping
< content-length: 32
<
<a href="/ping">See Other</a>.
The documentation mentions a "X-Forwarded-Prefix" header being set. I'm not sure if it is actually set. I cant see this in a curl -V. Is it the case that I need to have an app that detects this header and prepends it as a "base path" to its responses? Is there a way to configure Traefik to add this to the returning path?
Are there any other more configurable Docker aware proxies out there that I could use to route traffic to dynamically addressed gitlab review environments?
proxy docker http gitlab
proxy docker http gitlab
asked Feb 26 at 3:10
IvanIvan
115
115
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can tell GitLab where it's hosted so it sends the right redirect and links
docker run -e GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.local/review/master.project.user/ping'" ... gitlab/gitlab-ce:latest
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f955734%2fcan-traefik-maintain-a-path-prefix-if-a-backend-redirects-a-request-when-routin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can tell GitLab where it's hosted so it sends the right redirect and links
docker run -e GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.local/review/master.project.user/ping'" ... gitlab/gitlab-ce:latest
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
add a comment |
You can tell GitLab where it's hosted so it sends the right redirect and links
docker run -e GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.local/review/master.project.user/ping'" ... gitlab/gitlab-ce:latest
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
add a comment |
You can tell GitLab where it's hosted so it sends the right redirect and links
docker run -e GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.local/review/master.project.user/ping'" ... gitlab/gitlab-ce:latest
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
You can tell GitLab where it's hosted so it sends the right redirect and links
docker run -e GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.local/review/master.project.user/ping'" ... gitlab/gitlab-ce:latest
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab
answered 15 mins ago
kichikkichik
1216
1216
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f955734%2fcan-traefik-maintain-a-path-prefix-if-a-backend-redirects-a-request-when-routin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown