Skip to content

Commit

Permalink
Enhance nginx config for better troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Johnston committed Oct 7, 2023
1 parent 6549900 commit abb222d
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 5 deletions.
7 changes: 6 additions & 1 deletion cicd/Ansible-Playbook-Gateway-Configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
name: '{{ inventory_hostname }}'

- name: install nginx
apt: name=nginx
apt: name=nginx

- name: Remove default site
file:
path: "/etc/nginx/sites-enabled/default"
state: absent
37 changes: 35 additions & 2 deletions gateway/joeljca.site.blue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
server {
listen 80;
listen [::]:80;
listen 80 default_server;
server_name www.joelj.ca joelj.ca;
return 301 https://www.joelj.ca$request_uri;
}

server {
add_header X-Origin-LB $hostname;

# SSL configuration
#
Expand All @@ -13,4 +18,32 @@ server {
location / {
proxy_pass http://joeljcablue;
}
}

server {
# SSL configuration
#
listen 443 ssl;
ssl_certificate /etc/ssl/certs/joeljca-2022.crt;
ssl_certificate_key /etc/ssl/certs/joeljca-2022.rsa;

server_name wwwblue.joelj.ca;

location / {
proxy_pass http://joeljcablue;
}
}

server {
# SSL configuration
#
listen 443 ssl;
ssl_certificate /etc/ssl/certs/joeljca-2022.crt;
ssl_certificate_key /etc/ssl/certs/joeljca-2022.rsa;

server_name wwwgreen.joelj.ca;

location / {
proxy_pass http://joeljcagreen;
}
}
37 changes: 35 additions & 2 deletions gateway/joeljca.site.green
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
server {
listen 80;
listen [::]:80;
listen 80 default_server;
server_name www.joelj.ca joelj.ca;
return 301 https://www.joelj.ca$request_uri;
}

server {
add_header X-Origin-LB $hostname;

# SSL configuration
#
Expand All @@ -10,6 +15,34 @@ server {

server_name www.joelj.ca joelj.ca;

location / {
proxy_pass http://joeljcagreen;
}
}

server {
# SSL configuration
#
listen 443 ssl;
ssl_certificate /etc/ssl/certs/joeljca-2022.crt;
ssl_certificate_key /etc/ssl/certs/joeljca-2022.rsa;

server_name wwwblue.joelj.ca;

location / {
proxy_pass http://joeljcablue;
}
}

server {
# SSL configuration
#
listen 443 ssl;
ssl_certificate /etc/ssl/certs/joeljca-2022.crt;
ssl_certificate_key /etc/ssl/certs/joeljca-2022.rsa;

server_name wwwgreen.joelj.ca;

location / {
proxy_pass http://joeljcagreen;
}
Expand Down

0 comments on commit abb222d

Please sign in to comment.