Promethues https

My Prometheus, version 2.21.0

how can I configure https ?

–web.config.file tag is not working shows unknow flag

Is there any other way to config https?

“–web.config.file tag is not working shows unknow flag”

Please show us what filename you provided following that tag, and the content
(excluding comments) of that file.

In other words, please show us what configuration you tried to use to enable
HTTPS, so that we might see any mistakes.


Hi Pooh,

first of all Thanks for support

below is the prometheus.service configuration

Description=Prometheus systemd service unit

ExecReload=/bin/kill -HUP $MAINPID



below is the web-config.yml


Certificate and key files for server to use to authenticate to client.

cert_file: /etc/prometheus/cert/xyz.crt
key_file: /etc/prometheus/cert/xyz.key

Server policy for client authentication. Maps to ClientAuth Policies.

For more detail on clientAuth options:

tls package - crypto/tls -

NOTE: If you want to enable client authentication, you need to use

RequireAndVerifyClientCert. Other values are insecure.

[ client_auth_type: | default = “NoClientCert” ]

CA certificate for client certificate authentication to the server.

[ client_ca_file: /etc/prometheus/cert/xyz_ca.crt ]

Minimum TLS version that is acceptable.

[ min_version: | default = “TLS12” ]

[ min_version: “TLS1.2” ]

I’m pretty certain you just need to comment-out the lines starting with square
brackets as these are documentation examples and not directives.



I removed brackets and additional line is already commented

I have restarted service but below error shows

Error parsing commandline arguments: unknown long flag ‘–web.config.file’
prometheus: error: unknown long flag ‘–web.config.file’
prometheus.service: Main process exited, code=exited, status=1/FAILURE
prometheus.service: Failed with result ‘exit-code’.