For a given vhost, I want to redirect some routes/paths/URIs to HTTPS, while allowing others to be requested on HTTP.
Specifically, I want to allow Artifactory packages to be requested on HTTP, but require that the web UI be accessed via HTTPS.
How can I do this?
First, make sure your
server
block is listening for requests on both port 80 and 443. Then include a conditional on$scheme
and a permanentrewrite
.So to force
/webapp
and (anything under it) to HTTPS, you would use: