mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-11-04 01:15:14 +00:00 
			
		
		
		
	fixes https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1005 for more information look at: https://websistent.com/add-the-hsts-header-only-for-https-requests-nginx/
		
			
				
	
	
		
			9 lines
		
	
	
		
			315 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			315 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
{% if certificate and certificate_id > 0 -%}
 | 
						|
{% if ssl_forced == 1 or ssl_forced == true %}
 | 
						|
{% if hsts_enabled == 1 or hsts_enabled == true %}
 | 
						|
  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
 | 
						|
  add_header Strict-Transport-Security $hsts_header always;
 | 
						|
{% endif %}
 | 
						|
{% endif %}
 | 
						|
{% endif %}
 |