# How do i enable HTTPS for Daml JSON API using Apache Reverse Proxy

**URL:** <https://forum.canton.network/t/how-do-i-enable-https-for-daml-json-api-using-apache-reverse-proxy/6354>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [March 30, 2023, 5:37am UTC](https://forum.canton.network/t/how-do-i-enable-https-for-daml-json-api-using-apache-reverse-proxy/6354 "2023-03-30T05:37:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rocky](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/rocky/32/833_2.png) [@Rocky](https://forum.canton.network/u/Rocky)\
**Post date:** [March 30, 2023, 5:37am UTC](https://forum.canton.network/t/how-do-i-enable-https-for-daml-json-api-using-apache-reverse-proxy/6354/1 "2023-03-30T05:37:51Z")

</div>

Hi,  
Could you please give me the steps that needs to be followed to enable HTTPS for JSON API using Apache reverse proxy?

---

<div class="post-metadata">

**Author:** ![Chris\_Olson](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/chris_olson/32/1918_2.png) [@Chris\_Olson](https://forum.canton.network/u/Chris_Olson)\
**Post date:** [March 30, 2023, 12:09pm UTC](https://forum.canton.network/t/how-do-i-enable-https-for-daml-json-api-using-apache-reverse-proxy/6354/2 "2023-03-30T12:09:19Z")

</div>

To enable HTTPS for a JSON API using Apache reverse proxy, you can follow these steps:

1. Install an SSL/TLS certificate: First, you need to obtain an SSL/TLS certificate for your domain.

2. Configure Apache with SSL/TLS: Once you have the SSL/TLS certificate, you need to configure Apache to use it. You can do this by adding the following lines to your Apache configuration file (usually located in /etc/apache2/sites-available/000-default.conf):

SSLEngine on  
SSLProxyEngine on  
SSLCertificateFile /path/to/your/certificate.crt  
SSLCertificateKeyFile /path/to/your/private.key

Replace “/path/to/your/certificate.crt” and “/path/to/your/private.key” with the paths to your SSL/TLS certificate and private key.

1. Configure the reverse proxy: Next, you need to configure Apache to act as a reverse proxy for your JSON API. You can do this by adding the following lines to your Apache configuration file:

ProxyPass /api [https://your-api-domain.com/api](https://your-api-domain.com/api)  
ProxyPassReverse /api [https://your-api-domain.com/api](https://your-api-domain.com/api)

Replace “[https://your-api-domain.com/api](https://your-api-domain.com/api)” with the actual URL of your JSON API.

1. Restart Apache: Finally, restart Apache to apply the changes:

sudo service apache2 restart

After completing these steps, your JSON API should now be accessible over HTTPS through your Apache reverse proxy.

Hope this helps

---

<div class="post-metadata">

**Author:** ![Rocky](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/rocky/32/833_2.png) [@Rocky](https://forum.canton.network/u/Rocky)\
**Post date:** [March 30, 2023, 5:16pm UTC](https://forum.canton.network/t/how-do-i-enable-https-for-daml-json-api-using-apache-reverse-proxy/6354/3 "2023-03-30T17:16:45Z")

</div>

Thanks Chris for giving such a detail solution.
