Hey there. I’m new at NGINX. I’ve a problem about Load Balancing for my local websites. I create three servers on different three Ubuntu 16.04 core servers.
I need to configure this 3 servers for, when client try to reach “https://tac.local” from browser, load balancer take the request and make Load balance between my two webserver. I can use round robin type btw.
Here my config files;
upstream backend {
server 192.168.56.8;
server 192.168.56.12;
server 192.168.56.13;
}
server {
listen 80;
listen 443 ssl;
server_name tac.local;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
listen [::]:80;
server_name $host;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name tac.local;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
root /var/www/$host/public;
index index.php index.html index.htm index.nginx-debian.html;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
When i try to reach “https://tac.local” from Chrome, it’s saying; This page isn’t working tac.local redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS
Can you help me please?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello,
I would recommend trying to add the following right after the opening php tag in your
wp-config.php
file:Then clear the cache of your browser and test it again.
Let me know how it goes. Regards, Bobby
This comment has been deleted