try new method
This commit is contained in:
@@ -2,12 +2,6 @@
|
||||
# config file for ${name_site}
|
||||
############################################
|
||||
|
||||
upstream ${name_site}_backend {
|
||||
server ${name_service};
|
||||
server 1.1.1.1 backup;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
server_name ${name_site}.tryton.geeraert.eu www.${name_site}.tryton.geeraert.eu;
|
||||
|
||||
@@ -26,12 +20,23 @@ server {
|
||||
%{ if redirect_to_root_domain != true }
|
||||
|
||||
location / {
|
||||
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
${extra-value-location}
|
||||
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 Host $host;
|
||||
${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/ {
|
||||
root /var/www/certbot;
|
||||
@@ -84,21 +89,27 @@ server {
|
||||
# config file for ${name_site}
|
||||
############################################
|
||||
|
||||
upstream ${name_site}_backend_root {
|
||||
server ${name_service};
|
||||
server 1.1.1.1 backup;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name ${name_site}.geeraert.eu www.${name_site}.geeraert.eu;
|
||||
|
||||
location / {
|
||||
proxy_pass %{ if proxy_pass_https}https%{else}http%{ endif }://${name_site}_backend_root;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
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 Host $host;
|
||||
${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/ {
|
||||
root /var/www/certbot;
|
||||
|
||||
Reference in New Issue
Block a user