i have a frontends server with nginx, this serve the static content, and forward by proxy_pass the rest.
I have a problem with the backends servers and this return 403 error randomy, this is in another question.
For a immediately solution, i want only pass if apache return 200, i now have:
/etc/nginx/conf.d/upstreams
upstream balanced {
server 10.15.1.10:80;
server 10.15.1.11:80;
server 10.15.1.12:80;
}
And in the virtuals:
server {
access_log /var/log/nginx/myweb.access.log main buffer=32k;
error_log /var/log/nginx/myweb.error.log info;
#expires 31d;
#limit_conn gulag 5;
listen 80; # rcvbuf=64k backlog=128;
server_name myweb.com www.myweb.com;
include /etc/nginx/proxy_params;
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /srv/www/myweb/httpdocs;
}
location / {
proxy_pass http://balanced;
}
}
I need, in case of 403 response from the backs, try the next. as well as if the server does not respond.
Thanks, sorry my English