-
Notifications
You must be signed in to change notification settings - Fork 5
HowTo: Subdomains
Holger Hees edited this page Feb 4, 2020
·
5 revisions
If you register a subdomain, automatically all available authentication methods, like openid connect (if configured), form based login and basic auth, are enabled for this subdomain.
For details about the authentication methods check the main feature description
- name: copy apache vhost
vars:
sub_domain: "mysubdomain"
include: "templates/etc/apache2/_.ansible.vhost.d/mysubdomain.inc"
import_tasks: roles/apache/tasks/add_vhost.yml
Which defines a document root to {{htdocs_path}}mysubdomain/
and a proxy to an additional service running on http://127.0.0.1:8080/
which is available behind the url path /proxy
.
DocumentRoot "{{htdocs_path}}mysubdomain/"
<Directory {{htdocs_path}}mysubdomain/>
Options +FollowSymLinks -SymLinksIfOwnerMatch +MultiViews
AllowOverride None
</Directory>
<Location /proxy>
ProxyPass http://127.0.0.1:8080/
ProxyPreserveHost on
RequestHeader set X-Forwarded-Proto "https" env=HTTPS
</Location>
This configuration enables the following urls.
https://mysubdomain.<yourservername>/
https://mysubdomain.<yourservername>/proxy/
To force other authentication methods
https://fa-mysubdomain.<yourservername>/
https://fa-mysubdomain.<yourservername>/proxy/
https://ba-mysubdomain.<yourservername>/
https://ba-mysubdomain.<yourservername>/proxy/
- Home
- Motivation
- Main Features
- How to start
- Configuration
- Examples
- Special Roles