1

I was wondering if there is a way to setup the NGINX Reverse Proxy to "bypass" a server in a list that responds with 404 (or other error codes).

I have a clustered image board that I am doing bulk importing via 6 dedicated servers that are not part of the cluster as they do not use the shared storage. When the images are imported to the live system the other servers that are part of the cluster will obviously respond with 404 as they can not access the files that reside on the import servers.

Is there a way that i can add them to the list on NGINX and it will ignore the severs that respond with 404 and use the ones that respond correctly?

My NGINX Config for the reverse proxy:

upstream sequenzia-press {
#   server node-end1:80;
    server node1:80;
    server node2:80;
    server node3:80;
    server node4:80;
  }
upstream sequenzia-cpu {
    server node1:80;
    server node2:80;
    server node3:80;
    server node4:80;
  }
server {
        listen 80;
        root /var/www/html;
        server_name sequenzia.acr.moe;
        rewrite        ^ https://$server_name$request_uri? permanent;
}

server {
        listen 443 ssl;
        root /var/www/seq;
        server_name sequenzia.acr.moe;
        ssl_certificate      /etc/apache2/keyset/fullchain.pem;
        ssl_certificate_key  /etc/apache2/keyset/privkey.pem;
        ssl_protocols        TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers          RC4:HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;
        keepalive_timeout    70;
        ssl_session_cache    shared:SSL:10m;
        ssl_session_timeout  10m;
        client_max_body_size 500M;

        location / {
                add_header TangledFramework-Proxy-Datacenter Nagatenjouki/Core-MD;
                add_header TangledFramework-Proxy-Network Nagatenjouki/Production;
                add_header TangledFramework-Proxy-Transit Nagatenjouki/Shirai;
                add_header TangledFramework-Proxy-Service Sequenzia_Delivery;
                proxy_pass  http://sequenzia-cpu$request_uri;
        }
        location /post/import {
                add_header TangledFramework-Proxy-Datacenter Orion/Endymion-ATL-1;
                add_header TangledFramework-Proxy-Network Orion-Edge-CDN/Primary;
                add_header TangledFramework-Proxy-Transit Orion-Edge-A/Shirai-1;
                add_header TangledFramework-Proxy-Service Sequenzia_Delivery;
                proxy_pass  http://<Import RPC>$request_uri;
        }
        location /data {
                add_header TangledFramework-Proxy-Datacenter Orion/Endymion-ATL-1;
                add_header TangledFramework-Proxy-Network Orion-Edge-CDN/Primary;
                add_header TangledFramework-Proxy-Transit Orion-Edge-A/Shirai-1;
                add_header TangledFramework-Proxy-Service Sequenzia_Delivery;
                proxy_pass  http://sequenzia-press$request_uri;
        }
        location /se4trp {
                root /var/www/err;
                expires max;
        }
}
Paul
  • 2,755
  • 6
  • 24
  • 35

0 Answers0