mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	Unified http and https nginx proxy
This commit is contained in:
		@@ -4,7 +4,7 @@
 | 
			
		||||
  command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
 | 
			
		||||
 | 
			
		||||
- name: configure {{domain}}.conf
 | 
			
		||||
  template: src=domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
 | 
			
		||||
  template: src=roles/native-nginx-docker-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
 | 
			
		||||
  notify: restart nginx
 | 
			
		||||
 | 
			
		||||
- name: "create /etc/mailu/"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +0,0 @@
 | 
			
		||||
server
 | 
			
		||||
{
 | 
			
		||||
  server_name {{domain}};
 | 
			
		||||
  {% include 'roles/native-letsencrypt/templates/ssl_header.j2' %}
 | 
			
		||||
  {% include 'roles/native-nginx-docker-proxy/templates/https_proxy_pass.conf.j2'%}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
location /
 | 
			
		||||
{
 | 
			
		||||
  proxy_pass https://127.0.0.1:{{https_port}}/;
 | 
			
		||||
  proxy_set_header Host $host;
 | 
			
		||||
  proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
  proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
 | 
			
		||||
  proxy_connect_timeout       300;
 | 
			
		||||
  proxy_send_timeout          300;
 | 
			
		||||
  proxy_read_timeout          300;
 | 
			
		||||
  send_timeout                300;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,10 @@
 | 
			
		||||
location /
 | 
			
		||||
{
 | 
			
		||||
  {% if https_port is defined %}
 | 
			
		||||
    proxy_pass https://127.0.0.1:{{https_port}}/;
 | 
			
		||||
  {% else %}
 | 
			
		||||
    proxy_pass http://127.0.0.1:{{http_port}}/;
 | 
			
		||||
  {% endif %}
 | 
			
		||||
  proxy_set_header Host $host;
 | 
			
		||||
  proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
  proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user