I'm using HATEOAS for my REST API which is behind https, but link stay in http.
"links": [
{
"rel": "self",
"href": "http://..."
},
{
"rel": "object",
"href": "..."
}
]
Is it possible to config HATEOAS to point on my https ?
I resolved my problem by specifing the header as part of my virtual host configuration
<VirtualHost *:443>
RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost On
ServerName www.example.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
<Location/>
SSLRequireSSL
</Location>
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
</VirtualHost>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With