updated plain-site redirect to preserve the request host(name)
This commit is contained in:
		
							parent
							
								
									f028bfec59
								
							
						
					
					
						commit
						089dc4fbfb
					
				|  | @ -108,6 +108,7 @@ default_site_config: | ||||||
|   ip: |   ip: | ||||||
|   http_versions: [2, 1] |   http_versions: [2, 1] | ||||||
|   plain_site: true  # if http site (only used for redirect to https) should be created |   plain_site: true  # if http site (only used for redirect to https) should be created | ||||||
|  |   plain_redirect: 'preserve_domain'  # keep hostname from plain request => any other value will set the redirect to the main-domain | ||||||
| 
 | 
 | ||||||
|   config: {}  # site-specific setting-value pairs |   config: {}  # site-specific setting-value pairs | ||||||
|   config_additions: []  # lines that will 1-to-1 be appended to the site-config |   config_additions: []  # lines that will 1-to-1 be appended to the site-config | ||||||
|  |  | ||||||
|  | @ -30,7 +30,12 @@ | ||||||
|   Protocols {% if 2 in site.http_versions %}h2c {% endif %}{% if 1 in site.http_versions or 2 not in site.http_versions %}http/1.1{% endif %} |   Protocols {% if 2 in site.http_versions %}h2c {% endif %}{% if 1 in site.http_versions or 2 not in site.http_versions %}http/1.1{% endif %} | ||||||
| 
 | 
 | ||||||
|   # redirect all to secure connection |   # redirect all to secure connection | ||||||
|   Redirect permanent / https://{{ site.domain }} |   RewriteEngine On | ||||||
|  | {% if site.plain_redirect == 'preserve_domain' %} | ||||||
|  |   RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} | ||||||
|  | {% else %} | ||||||
|  |   RewriteRule ^ https://{{ site.domain }}%{REQUEST_URI} | ||||||
|  | {% endif %} | ||||||
| 
 | 
 | ||||||
| </VirtualHost> | </VirtualHost> | ||||||
| {% endif %} | {% endif %} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue