I’ve some Apache mod_rewrite guidelines set as much as redirect Maven deploys from one url to a different. We’re within the means of migrating from Nexus to Artifactory and want these redirects arrange in order that groups can nonetheless use the Nexus URLs for a time frame with out breaking builds. This is an instance of our mod_rewrite rule:
RewriteRule ^/nexus/content material/repositories/nexus-repository/(.*)$ https://artifactory-instance.internet/repository/$1 [NE,R=301,L]
The rule efficiently redirects GET requests to the brand new Artifactory URL, however we’re having a problem of the Authorization Header being dropped on the redirect. We get a 401 Error, and by operating a cURL PUT command to push particular person artifacts, I will see that the Authorization Header is being dropped:
... > PUT /nexus/content material/repositories/nexus-repository/com/maven/hello-world/1.0.0/hello-world-1.0.0.jar HTTP/1.1 > Host: nexus-instance.com > Authorization: Fundamental XXXXXXXXXX > Consumer-Agent: curl/7.54.0 > Settle for: */* > Content material-Size: 2540 > Anticipate: 100-continue > < HTTP/1.1 301 Moved Completely < Date: Thu, 23 Apr 2020 17:27:22 GMT < Server: Apache/2.4.37 (Purple Hat Enterprise Linux) < Location: https://artifactory-instance.internet/repository/com/maven/hello-world/1.0.0/hello-world-1.0.0.jar < Content material-Size: 311 < Connection: shut < Content material-Kind: textual content/html; charset=iso-8859-1 ... > PUT /repository/com/maven/hello-world/1.0.0/hello-world-1.0.0.jar HTTP/1.1 > Host: artifactory-instance.internet > Consumer-Agent: curl/7.54.0 > Settle for: */* > Content material-Size: 2540 > Anticipate: 100-continue > < HTTP/1.1 100 Proceed * We're utterly uploaded and superb < HTTP/1.1 401 Unauthorized < Date: Thu, 23 Apr 2020 17:27:22 GMT ... * Authentication downside. Ignoring this. < WWW-Authenticate: Fundamental realm="Artifactory Realm" < Content material-Kind: software/json;charset=ISO-8859-1 < Switch-Encoding: chunked ...
cURL has a flag referred to as
--location-trusted. Once I apply it to my check cURL command, it passes the Authorization Header to the redirect.
My query is, is there any form of equal to
--location-trusted in httpd? What can I do to move the authentication header alongside by way of the redirect?