Welcome! Log In Create A New Profile

Advanced

Re: Upstream Fallback if Backends can´t be reached

December 16, 2011 08:03AM
here is my current nginx.conf:

##########################################
user nginx;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream example-online {
healthcheck_enabled;
healthcheck_delay 5000;
healthcheck_timeout 5000;
healthcheck_failcount 1;
server 10.194.1.107:8080 max_fails=2 fail_timeout=2s weight=2;
## server 10.194.1.108:8080 max_fails=2 fail_timeout=2s weight=2;
sticky;
ip_hash;
}
upstream example-org {
healthcheck_enabled;
healthcheck_delay 5000;
healthcheck_timeout 5000;
healthcheck_failcount 1;
server 10.194.1.107:8090 max_fails=2 fail_timeout=2s weight=2;
## server 10.194.1.108:8090 max_fails=2 fail_timeout=2s weight=2;
sticky;
ip_hash;
}
gzip on;
server {
listen 10.194.100.50:80;
server_name example.de www.example.de;
rewrite ^ http://www.testing.de permanent;
}
server {
ssl on;
ssl_prefer_server_ciphers on;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers HIGH:!SSLv2:!ADH:!aNULL:!eNULL:!NULL;
listen 10.194.100.50:443 ssl;
ssl_certificate ssl/nginx-test.crt;
ssl_certificate_key ssl/nginx-test.key;
keepalive_timeout 60;
server_tokens off;
proxy_intercept_errors on;
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
return 403;
}
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) ) {
return 403;
}
server_name example-org;
location /example-org {
proxy_pass http://example-org;
error_page 400 401 404 408 502 503 504 /error/error.html;
}
server_name example-online;
location /example-online {
proxy_pass http://example-online;
error_page 400 401 404 408 502 503 504 /error/error.html;
}
location /error {
root /var/www;
}
location / {
root /var/www/error;
index error.html;
}
}
}
###########################
Subject Author Posted

Upstream Fallback if Backends can´t be reached

kperas December 15, 2011 11:10AM

Re: Upstream Fallback if Backends can´t be reached

Brian Akins December 15, 2011 07:30PM

Re: Upstream Fallback if Backends can´t be reached

kperas December 16, 2011 02:19AM

Re: Upstream Fallback if Backends can´t be reached

kperas December 16, 2011 08:02AM

Re: Upstream Fallback if Backends can´t be reached

kperas December 16, 2011 08:03AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready