2014-09-29 20:04:40 +08:00
|
|
|
<VirtualHost *:*>
|
|
|
|
|
|
|
|
DocumentRoot /var/www/html
|
|
|
|
ServerName localhost
|
2015-06-08 21:11:48 +08:00
|
|
|
|
|
|
|
# See https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode
|
|
|
|
<Directory /var/www/html>
|
|
|
|
RewriteEngine on
|
|
|
|
|
|
|
|
# Don't rewrite files or directories
|
|
|
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
|
|
|
RewriteCond %{REQUEST_FILENAME} -d
|
|
|
|
RewriteRule ^ - [L]
|
|
|
|
|
|
|
|
# Rewrite everything else to index.html to allow html5 state links
|
|
|
|
RewriteRule ^ index.html [L]
|
|
|
|
</Directory>
|
2014-09-29 20:04:40 +08:00
|
|
|
|
2015-02-13 18:34:29 +08:00
|
|
|
# When FRONTEND_BROWSE_ONLY_MODE is defined in envvars
|
|
|
|
# we will only allow GET requests to the frontend. All other
|
|
|
|
# HTTP requests will be aborted with a HTTP 403 Error.
|
|
|
|
|
|
|
|
<IfDefine FRONTEND_BROWSE_ONLY_MODE>
|
|
|
|
<Location />
|
|
|
|
<LimitExcept GET>
|
|
|
|
Order Allow,Deny
|
|
|
|
Deny From All
|
|
|
|
</LimitExcept>
|
|
|
|
</Location>
|
|
|
|
</IfDefine>
|
|
|
|
|
2014-09-29 20:04:40 +08:00
|
|
|
# Proxy all docker REST API registry
|
|
|
|
# requests to the docker registry server.
|
|
|
|
|
2014-11-15 09:04:56 +08:00
|
|
|
<IfModule ssl_module>
|
2014-11-28 20:38:43 +08:00
|
|
|
SSLProxyEngine on
|
|
|
|
# SSLProxyVerify none
|
|
|
|
SSLProxyCheckPeerCN off
|
|
|
|
SSLProxyCheckPeerName off
|
2014-11-15 09:04:56 +08:00
|
|
|
</IfModule>
|
2014-09-29 20:04:40 +08:00
|
|
|
ProxyPreserveHost On
|
2015-09-16 16:37:48 +08:00
|
|
|
ProxyPass /v2/ ${DOCKER_REGISTRY_SCHEME}://${DOCKER_REGISTRY_HOST}:${DOCKER_REGISTRY_PORT}/v2/
|
|
|
|
ProxyPassReverse /v2/ ${DOCKER_REGISTRY_SCHEME}://${DOCKER_REGISTRY_HOST}:${DOCKER_REGISTRY_PORT}/v2/
|
2014-09-29 20:04:40 +08:00
|
|
|
|
|
|
|
# Enable Kerberos authentication if requested
|
|
|
|
# NOTE: The module will be loaded or unloaded by the /root/start-apache.sh script.
|
|
|
|
# And the variables are also set by the script.
|
|
|
|
|
|
|
|
<IfModule mod_auth_kerb.c>
|
|
|
|
<Location "/">
|
|
|
|
Options FollowSymLinks Indexes
|
|
|
|
|
|
|
|
AuthType Kerberos
|
|
|
|
AuthName "${AUTH_NAME}"
|
|
|
|
KrbAuthRealms ${AUTH_KRB_REALMS}
|
|
|
|
KrbServiceName ${AUTH_KRB_SERVICE_NAME}
|
|
|
|
Krb5Keytab ${AUTH_KRB5_KEYTAB}
|
|
|
|
KrbMethodNegotiate on
|
|
|
|
KrbMethodK5Passwd on
|
|
|
|
|
|
|
|
Require valid-user
|
|
|
|
</Location>
|
|
|
|
</IfModule>
|
|
|
|
|
|
|
|
# Enable SSL encryption if requested
|
|
|
|
# NOTE: The module will be loaded or unloaded by the /root/start-apache.sh script.
|
|
|
|
|
|
|
|
<IfModule ssl_module>
|
2014-11-15 09:04:56 +08:00
|
|
|
<IfDefine USE_SSL>
|
|
|
|
ServerName localhost
|
|
|
|
SSLEngine on
|
|
|
|
SSLCertificateFile /etc/apache2/server.crt
|
|
|
|
SSLCertificateKeyFile /etc/apache2/server.key
|
|
|
|
</IfDefine>
|
2014-09-29 20:04:40 +08:00
|
|
|
</IfModule>
|
|
|
|
|
2014-10-10 19:51:41 +08:00
|
|
|
# Allow ping and users to run unauthenticated.
|
2015-09-16 16:37:48 +08:00
|
|
|
<Location /v2/_ping>
|
2014-10-10 19:51:41 +08:00
|
|
|
Satisfy any
|
|
|
|
Allow from all
|
|
|
|
</Location>
|
|
|
|
|
2014-09-29 20:04:40 +08:00
|
|
|
</VirtualHost>
|