<p>I'm currently in the process of dockerizing a Laravel app and integrating it with Kubernetes. I'm not well-versed in php, so I could be missing something obvious. I managed to access the app with http through the browser running it via docker.</p>

<p>But for some reason whenever I access it through my Kubernetes cluster, regardless of if I type the URL manually, it redirects me to the https version of the URL. And this throws several <code>Mixed Content: The page at '&lt;URL&gt;' was loaded over HTTPS, but requested an insecure script '&lt;URL&gt;'</code> errors.</p>

<p>I've tried configuring Apache to use self-signed SSL, but I was unable to get it to work, and the cluster does seem to work on http with Angular apps anyway.</p>

<p>My Dockerfile, Kubernetes config files and apache.conf files look like this:</p>

<p><em>(Note that I removed env values for security and brevity)</em></p>

<p><strong>Dockerfile</strong></p>

<pre><code>FROM php:7.2-apache
ENV APP_ENV=prod
ENV APACHE_DOCUMENT_ROOT /var/www/html

RUN docker-php-ext-install pdo pdo_mysql
RUN a2enmod rewrite
COPY ./apache.conf /etc/apache2/sites-available/000-default.conf
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

WORKDIR /var/www/html/my-app
COPY . .
RUN apt-get update &amp;&amp; apt-get install -y git zip unzip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/bin --filename=composer
RUN /bin/composer install
</code></pre>

<p><strong>apache.conf</strong></p>

<pre><code>&lt;VirtualHost *:80&gt;
    RewriteEngine On
    DocumentRoot ${APACHE_DOCUMENT_ROOT}

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /my-app "/var/www/html/my-app/public"
    &lt;Directory "/var/www/html/my-app"&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    &lt;/Directory&gt;

&lt;/VirtualHost&gt;
</code></pre>

<p><strong>k8s config files</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: in-check
        image: registry-url:5000/my-app
        ports:
          - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: my-app-cluster-ip
spec:
  type: ClusterIP
  selector:
    app: my-app
  ports:
  - port: 8082
    targetPort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-app-ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - http:
        paths:
          - path: /my-app/?(.*)
            backend:
              serviceName: my-app-cluster-ip
              servicePort: 8082
</code></pre>

<p>Any idea what might be causing this issue?</p>

<p>Any and all help is appreciated.</p>

<p><strong><em>Update: it seems to load properly using http on my EKS cluster, but still results in the above errors on my copy of minikube.</em></strong></p>

<p><em>Edit: <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml" rel="nofollow noreferrer">here's the link</a> to the Ingress controller config I'm using.</em></p>

AdHorger
<p>So I was unable to get the app to run on <code>HTTP</code> on my local copy of minikube, but after @Eduardo Baitello's advice, I changed all the resources' relative paths to full URLs with the <code>HTTPS</code> protocol included.</p>

<p>This isn't ideal since if the domain name or IP changes I have to manually update all resource URLs, but this is the only workaround I can find right now.</p>
