Created
September 18, 2021 21:05
-
-
Save liejuntao001/84c4b0a76a7f70891772cd1f3c6ad211 to your computer and use it in GitHub Desktop.
Reverse Proxy Settings for Apache generated by Jfrog Artifactory 7.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################### | |
## this configuration was generated by JFrog Artifactory ## | |
########################################################### | |
<VirtualHost *:443> | |
ProxyPreserveHost On | |
ProxyAddHeaders off | |
ServerName artifact.myjfrog.com | |
ServerAlias *.artifact.myjfrog.com | |
ServerAdmin server@admin | |
SSLEngine on | |
SSLCertificateFile /etc/ssh/server.crt | |
SSLCertificateKeyFile /etc/ssh/private.key | |
SSLProxyEngine on | |
## Application specific logs | |
## ErrorLog ${APACHE_LOG_DIR}/artifact.myjfrog.com-error.log | |
## CustomLog ${APACHE_LOG_DIR}/artifact.myjfrog.com-access.log combined | |
AllowEncodedSlashes On | |
RewriteEngine on | |
RewriteCond %{SERVER_PORT} (.*) | |
RewriteRule (.*) - [E=my_server_port:%1] | |
## NOTE: The 'REQUEST_SCHEME' Header is supported only from apache version 2.4 and above | |
RewriteCond %{REQUEST_SCHEME} (.*) | |
RewriteRule (.*) - [E=my_scheme:%1] | |
RewriteCond %{HTTP_HOST} (.*) | |
RewriteRule (.*) - [E=my_custom_host:%1] | |
RewriteCond "%{REQUEST_URI}" "^/(v1|v2)/" | |
RewriteCond "%{HTTP_HOST}" "^(.*)\.artifact.myjfrog.com$" | |
RewriteRule "^/(v1|v2)/(.*)$" "/artifactory/api/docker/%1/$1/$2" [PT] | |
RewriteRule ^(/)?$ /ui/ [R,L] | |
RewriteRule ^/ui$ /ui/ [R,L] | |
RequestHeader set Host %{my_custom_host}e | |
RequestHeader set X-Forwarded-Port %{my_server_port}e | |
## NOTE: {my_scheme} requires a module which is supported only from apache version 2.4 and above | |
RequestHeader set X-Forwarded-Proto %{my_scheme}e | |
RequestHeader set X-JFrog-Override-Base-Url %{my_scheme}e://artifact.myjfrog.com:%{my_server_port}e | |
Header always set Strict-Transport-Security "" | |
ProxyPassReverseCookiePath / / | |
ProxyRequests off | |
ProxyPreserveHost on | |
ProxyPass "/artifactory/" http://artifact:8081/artifactory/ | |
ProxyPassReverse "/artifactory/" http://artifact:8081/artifactory/ | |
ProxyPass "/" http://artifact:8082/ | |
ProxyPassReverse "/" http://artifact:8082/ | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment