Skip to content

Commit

Permalink
Merge pull request #10 from hbarza/fix-proxy-port-mapping-public-inte…
Browse files Browse the repository at this point in the history
…rnal

fix: set proxy server templates to listen to defined public port
  • Loading branch information
hbarza authored May 9, 2023
2 parents 833b136 + d19a0c9 commit 2ab836d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions templates/etc/apache2/sites-enabled/template.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ ansible_managed | comment }}

{% for ip in ansible_all_ipv4_addresses %}
Listen {{ ip }}:{{ item.port }}
Listen {{ ip }}:{{ item.port_public }}

<VirtualHost {{ ip }}:{{ item.port }}>
<VirtualHost {{ ip }}:{{ item.port_public }}>
ProxyPreserveHost On

<Location "/">
Expand All @@ -16,4 +16,4 @@ Listen {{ ip }}:{{ item.port }}
</Location>

</VirtualHost>
{% endfor %}
{% endfor %}
2 changes: 1 addition & 1 deletion templates/etc/nginx/sites-enabled/template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

server {
{% for ip in ansible_all_ipv4_addresses %}
listen {{ ip }}:{{ item.port }}{% if nginx_prometheus_tls_certificate_path is defined %} ssl http2{% endif %};
listen {{ ip }}:{{ item.port_public }}{% if nginx_prometheus_tls_certificate_path is defined %} ssl http2{% endif %};
{% endfor %}

## We use "_" as a dirty trick to achieve catch-all behavior. See http://nginx.org/en/docs/http/server_names.html
Expand Down

0 comments on commit 2ab836d

Please sign in to comment.