Traefik: Ajax call to https url resulting in Mixed Content, insecure XMLHttpRequest request errorHow to manage a redirect request after a jQuery Ajax callHow many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?Ajax request returns 200 OK, but an error event is fired instead of successHow to add proper labels in docker for SSL?Internal Server Error with Traefik HTTPS backend on port 443Rewriting content URLs with traefikCannot set Traefik via “labels” inside docker-compose.ymlI'm trying to configure traefik + docker, but the browser loads the https url forever, do you know why?Traefik HTTPS entry points configurations not working via lets encryptexample traefik to docker with http work but not with https

What does a Light weapon mean mechanically?

Is the Dodge action perceptible to other characters?

Why did it become so much more expensive to start a university?

My research paper filed as a patent in China by my Chinese supervisor without me as inventor

Make 2019 with single digits

Why is template constructor preferred to copy constructor?

How would you control supersoldiers in a late iron-age society?

Might have gotten a coworker sick, should I address this?

What is a realistic time needed to get a properly trained army?

Can I conceal an antihero's insanity - and should I?

Cannot find Database Mail feature in SQL Server Express 2012 SP1

Why is my fire extinguisher emptied after one use?

Is a suit against a University Dorm for changing policies on a whim likely to succeed (USA)?

What is the derivative of an exponential function with another function as its base?

Examples of LEGO Rubber Bands Used For Friction Enclosure?

What jurisdiction do Scottish courts have over the Westminster parliament?

Some Prime Peerage

If I want an interpretable model, are there methods other than Linear Regression?

Double it your way

Can I toggle Do Not Disturb on/off on my Mac as easily as I can on my iPhone?

Bash, import output from command as command

What was redacted in the Yellowhammer report? (Point 15)

Parallel resistance in electric circuits

Where to disclose a zero day vulnerability



Traefik: Ajax call to https url resulting in Mixed Content, insecure XMLHttpRequest request error


How to manage a redirect request after a jQuery Ajax callHow many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?Ajax request returns 200 OK, but an error event is fired instead of successHow to add proper labels in docker for SSL?Internal Server Error with Traefik HTTPS backend on port 443Rewriting content URLs with traefikCannot set Traefik via “labels” inside docker-compose.ymlI'm trying to configure traefik + docker, but the browser loads the https url forever, do you know why?Traefik HTTPS entry points configurations not working via lets encryptexample traefik to docker with http work but not with https






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am getting this error for all ajax call on my web application..



Mixed Content: The page at 'https://one.mydomain.com' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://one.mydomain.com/api/get-all-agents/'. This request has been blocked; the content must be served over HTTPS.



The code also made the request as an absolute url on https.



All the applications are running on docker containers. Requests are proxied through Traefik.



I have tried adding adding backslash to the request to no avail.



The code making the call



var admin_base_url = "https://one.mydomain.com/

var url = admin_base_url + "api/get-all-agents/";

$http.get(url).success(function(response)
$scope.agents = response.agents;

);


and



Here is my Traefik toml configurations



debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false

[acme]
email = "user@mydomain.com"
acmeLogging = false
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"



and my Compose file



version: '3'

services:
traefik:
image: traefik:v1.7-alpine
container_name: traefik
restart: unless-stopped
networks:
- webgateway
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/ec2-user/traefik/traefik.toml:/traefik.toml
networks:
webgateway:
driver: bridge


and my application compose have this label



 labels:
traefik.enable : "true"
traefik.application.frontend.rule : "Host:one.mydomain.com"
traefik.application-adminportal.port : "80"
networks:
- web


I have added X-Forwarded-Proto = "https" to the application labels and still having the same issue.



I viewed all the links suggested by the question model before asking here.



Please help.



Update



Browser redirecting to HTTP from HTTPS, then HTTP request resulted in the error
enter image description here










share|improve this question


























  • This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

    – Johnson Bayo Adekunle
    Apr 1 at 7:44

















1















I am getting this error for all ajax call on my web application..



Mixed Content: The page at 'https://one.mydomain.com' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://one.mydomain.com/api/get-all-agents/'. This request has been blocked; the content must be served over HTTPS.



The code also made the request as an absolute url on https.



All the applications are running on docker containers. Requests are proxied through Traefik.



I have tried adding adding backslash to the request to no avail.



The code making the call



var admin_base_url = "https://one.mydomain.com/

var url = admin_base_url + "api/get-all-agents/";

$http.get(url).success(function(response)
$scope.agents = response.agents;

);


and



Here is my Traefik toml configurations



debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false

[acme]
email = "user@mydomain.com"
acmeLogging = false
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"



and my Compose file



version: '3'

services:
traefik:
image: traefik:v1.7-alpine
container_name: traefik
restart: unless-stopped
networks:
- webgateway
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/ec2-user/traefik/traefik.toml:/traefik.toml
networks:
webgateway:
driver: bridge


and my application compose have this label



 labels:
traefik.enable : "true"
traefik.application.frontend.rule : "Host:one.mydomain.com"
traefik.application-adminportal.port : "80"
networks:
- web


I have added X-Forwarded-Proto = "https" to the application labels and still having the same issue.



I viewed all the links suggested by the question model before asking here.



Please help.



Update



Browser redirecting to HTTP from HTTPS, then HTTP request resulted in the error
enter image description here










share|improve this question


























  • This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

    – Johnson Bayo Adekunle
    Apr 1 at 7:44













1












1








1


1






I am getting this error for all ajax call on my web application..



Mixed Content: The page at 'https://one.mydomain.com' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://one.mydomain.com/api/get-all-agents/'. This request has been blocked; the content must be served over HTTPS.



The code also made the request as an absolute url on https.



All the applications are running on docker containers. Requests are proxied through Traefik.



I have tried adding adding backslash to the request to no avail.



The code making the call



var admin_base_url = "https://one.mydomain.com/

var url = admin_base_url + "api/get-all-agents/";

$http.get(url).success(function(response)
$scope.agents = response.agents;

);


and



Here is my Traefik toml configurations



debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false

[acme]
email = "user@mydomain.com"
acmeLogging = false
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"



and my Compose file



version: '3'

services:
traefik:
image: traefik:v1.7-alpine
container_name: traefik
restart: unless-stopped
networks:
- webgateway
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/ec2-user/traefik/traefik.toml:/traefik.toml
networks:
webgateway:
driver: bridge


and my application compose have this label



 labels:
traefik.enable : "true"
traefik.application.frontend.rule : "Host:one.mydomain.com"
traefik.application-adminportal.port : "80"
networks:
- web


I have added X-Forwarded-Proto = "https" to the application labels and still having the same issue.



I viewed all the links suggested by the question model before asking here.



Please help.



Update



Browser redirecting to HTTP from HTTPS, then HTTP request resulted in the error
enter image description here










share|improve this question
















I am getting this error for all ajax call on my web application..



Mixed Content: The page at 'https://one.mydomain.com' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://one.mydomain.com/api/get-all-agents/'. This request has been blocked; the content must be served over HTTPS.



The code also made the request as an absolute url on https.



All the applications are running on docker containers. Requests are proxied through Traefik.



I have tried adding adding backslash to the request to no avail.



The code making the call



var admin_base_url = "https://one.mydomain.com/

var url = admin_base_url + "api/get-all-agents/";

$http.get(url).success(function(response)
$scope.agents = response.agents;

);


and



Here is my Traefik toml configurations



debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false

[acme]
email = "user@mydomain.com"
acmeLogging = false
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"



and my Compose file



version: '3'

services:
traefik:
image: traefik:v1.7-alpine
container_name: traefik
restart: unless-stopped
networks:
- webgateway
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/ec2-user/traefik/traefik.toml:/traefik.toml
networks:
webgateway:
driver: bridge


and my application compose have this label



 labels:
traefik.enable : "true"
traefik.application.frontend.rule : "Host:one.mydomain.com"
traefik.application-adminportal.port : "80"
networks:
- web


I have added X-Forwarded-Proto = "https" to the application labels and still having the same issue.



I viewed all the links suggested by the question model before asking here.



Please help.



Update



Browser redirecting to HTTP from HTTPS, then HTTP request resulted in the error
enter image description here







javascript ajax xmlhttprequest lets-encrypt traefik






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 10:42







Johnson Bayo Adekunle

















asked Mar 28 at 9:28









Johnson Bayo AdekunleJohnson Bayo Adekunle

216 bronze badges




216 bronze badges















  • This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

    – Johnson Bayo Adekunle
    Apr 1 at 7:44

















  • This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

    – Johnson Bayo Adekunle
    Apr 1 at 7:44
















This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

– Johnson Bayo Adekunle
Apr 1 at 7:44





This issue has been resolved without making any change to Traefik settings. I used absolute url for ajax calls and globally allowed CORS.

– Johnson Bayo Adekunle
Apr 1 at 7:44












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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/4.0/"u003ecc by-sa 4.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
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55394133%2ftraefik-ajax-call-to-https-url-resulting-in-mixed-content-insecure-xmlhttprequ%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55394133%2ftraefik-ajax-call-to-https-url-resulting-in-mixed-content-insecure-xmlhttprequ%23new-answer', 'question_page');

);

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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript