<p>Is there any way to configure promtail to send logs to loki via https-ingress?</p>
<p><code>promtail</code> ---&gt; <code>https-ingress</code> ---&gt; <code>loki</code></p>
<p>I used this helm chart <a href="https://github.com/grafana/helm-charts/tree/main/charts/promtail" rel="nofollow noreferrer">promtail</a> and configured <a href="https://github.com/grafana/helm-charts/blob/main/charts/promtail/values.yaml#L238" rel="nofollow noreferrer">loki url</a> as <code>http://gateway.loki.monitoring.example.com:80/loki/api/v1/push</code>. After I deploy <code>promtail</code> chart I see below errors in <code>promtail</code> pod</p>
<pre><code>level=error ts=2022-03-28T14:10:23.740581978Z caller=client.go:360 component=client host=gateway.loki.monitoring.example.com:80 msg=&quot;f
inal error sending batch&quot; status=308 error=&quot;server returned HTTP status 308 Permanent Redirect (308): &lt;html&gt;&quot;
</code></pre>
<p>I even specified https in loki url as <code>https://gateway.loki.monitoring.example.com:80/loki/api/v1/push</code> but still failing</p>
<pre><code>level=warn ts=2022-03-28T14:27:47.976570998Z caller=client.go:349 component=client host=gateway.loki.monitoring.example:80 msg=&quot;er
ror sending batch, will retry&quot; status=-1 error=&quot;Post \&quot;https://gateway.loki.monitoring.example.com:80/loki/api/v1/push\&quot;: http: server
 gave HTTP response to HTTPS client&quot;

</code></pre>
<p>I found this config <a href="https://grafana.com/docs/loki/latest/installation/helm/#run-loki-behind-https-ingress" rel="nofollow noreferrer">https://grafana.com/docs/loki/latest/installation/helm/#run-loki-behind-https-ingress</a>, but it is outdated</p>
<p>NOTE:</p>
<ul>
<li>I have not configured any https at loki side.</li>
<li>Configured <a href="https://github.com/grafana/helm-charts/tree/main/charts/loki-distributed" rel="nofollow noreferrer"><code>loki-distributed</code></a> chart's ingress like below(and rest ingress config are default)</li>
</ul>
<pre><code>...
  ingress:
    # -- Specifies whether an ingress for the gateway should be created
    enabled: true
    # -- Ingress Class Name. MAY be required for Kubernetes versions &gt;= 1.18
    ingressClassName: monitoring-ingress
    # -- Annotations for the gateway ingress
    annotations:
      cert-manager.io/cluster-issuer: monitoring-cluster-issuer
    # -- Hosts configuration for the gateway ingress
    hosts:
      - host: gateway.loki.monitoring.example.com
        paths:
          - path: /
            # -- pathType (e.g. ImplementationSpecific, Prefix, .. etc.) might also be required by some Ingress Controllers
            pathType: Prefix
    # -- TLS configuration for the gateway ingress
    tls:
      - secretName: loki-gateway-tls-certs
        hosts:
          - gateway.loki.monitoring.example.com
...
</code></pre>
<p>Did I miss any ingress config at loki?</p>

Veerendra K
<p>After I played some time, I understood I need to remove port and specify <code>https</code> for the loki URL. Should be like below</p>
<pre><code>https://gateway.loki.monitoring.example.com/loki/api/v1/push
</code></pre>
