try new method
This commit is contained in:
@@ -2,12 +2,6 @@
|
|||||||
# config file for ${name_site}
|
# config file for ${name_site}
|
||||||
############################################
|
############################################
|
||||||
|
|
||||||
upstream ${name_site}_backend {
|
|
||||||
server ${name_service};
|
|
||||||
server 1.1.1.1 backup;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
server_name ${name_site}.tryton.geeraert.eu www.${name_site}.tryton.geeraert.eu;
|
server_name ${name_site}.tryton.geeraert.eu www.${name_site}.tryton.geeraert.eu;
|
||||||
|
|
||||||
@@ -26,13 +20,24 @@ server {
|
|||||||
%{ if redirect_to_root_domain != true }
|
%{ if redirect_to_root_domain != true }
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend;
|
set $backend_${name_site} "${name_service}";
|
||||||
|
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://$backend_${name_site};
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
${extra-value-location}
|
${extra-value-location}
|
||||||
|
|
||||||
|
proxy_intercept_errors on;
|
||||||
|
# 502 = DNS can't resolve / Service down
|
||||||
|
# 504 = Gateway Timeout
|
||||||
|
error_page 502 504 = @backup_site;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
location @backup_site {
|
||||||
|
proxy_pass http://1.1.1.1;
|
||||||
|
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/certbot;
|
root /var/www/certbot;
|
||||||
}
|
}
|
||||||
@@ -84,22 +89,28 @@ server {
|
|||||||
# config file for ${name_site}
|
# config file for ${name_site}
|
||||||
############################################
|
############################################
|
||||||
|
|
||||||
upstream ${name_site}_backend_root {
|
|
||||||
server ${name_service};
|
|
||||||
server 1.1.1.1 backup;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
server_name ${name_site}.geeraert.eu www.${name_site}.geeraert.eu;
|
server_name ${name_site}.geeraert.eu www.${name_site}.geeraert.eu;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend_root;
|
set $backend_root_${name_site} "${name_service}";
|
||||||
|
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://$backend_root_${name_site};
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
${extra-value-location}
|
${extra-value-location}
|
||||||
|
|
||||||
|
proxy_intercept_errors on;
|
||||||
|
# 502 = DNS can't resolve / Service down
|
||||||
|
# 504 = Gateway Timeout
|
||||||
|
error_page 502 504 = @backup_site;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
location @backup_site {
|
||||||
|
proxy_pass http://1.1.1.1;
|
||||||
|
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/certbot;
|
root /var/www/certbot;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user