Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGX-733: do not remove site configs that match given patterns #36

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ wp_system_path: "/home/{{ system_user }}/{{ wp_system_folder }}"

# metavar that helps control some tasks that should not run
install_wordpress: true

# site config conf files matching these patterns will not be removed from /etc/nginx/conf.d/
preserve_site_config_patterns:
- "{{ site_domain }}.conf"
11 changes: 10 additions & 1 deletion tasks/ultrastack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
file: vars/nginx_cache_profiles/{{ nginx_cache_profile }}.yml
tags: profile

- name: Configure upstream server groups
template:
src: etc/nginx/conf.d/upstream.conf.j2
dest: /etc/nginx/conf.d/upstream.conf
owner: root
group: root
mode: 0644
notify: restart nginx

- name: Configure site-specific NGINX proxy
template:
src: etc/nginx/conf.d/site.conf.j2
Expand Down Expand Up @@ -43,7 +52,7 @@
paths: /etc/nginx/conf.d
file_type: file
contains: '.*site\.conf\.j2.*'
excludes: "{{ site_domain }}.conf"
excludes: "{{ preserve_site_config_patterns }}"
register: nginx_extra_sites

- name: Remove extra site configs
Expand Down
9 changes: 0 additions & 9 deletions templates/etc/nginx/conf.d/site.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
# tags: site.conf.j2


upstream http_backend {
{% if use_letsencrypt is defined and use_letsencrypt|bool %}
server 127.0.0.1:8443;
{% else %}
server 127.0.0.1:8080;
{% endif %}
keepalive 2;
}

server {
listen 80;
{% if use_letsencrypt is defined and use_letsencrypt|bool %}
Expand Down
Loading