Welcome! Log In Create A New Profile

Advanced

Hello All - No Pictures displayed when using load balancer

Posted by starblade 
Hello All - No Pictures displayed when using load balancer
July 24, 2015 04:03PM
Hello All,

My name is Troy (a.k.a Starblade).

Hope everyone is doing well.

I am new to Nginx and really enjoy how simple it is compared to other software load balancers.

Hopefully someone could help be with an issue.

Problem:
The images on my web pages do not show up when going through the load balancer.
They show up fine going directly to public address of nodes being load balanced.

Note: I am running everything in docker container.

My test environment is running on Digital Ocean Cloud servers.

I am running 4 Nodes.

-= Manager node x 1 =-
- running dockerized version of Nginx
- running dockerized version of MySQL
- running dockerized ambassador container to allow connection other containers on other hosts

-= Process node x 3 =-
- running dockerized version of Apache/PHP with web pages the tests connection to MySQL on different host
- running dockerized ambassador container to allow connection other containers on other hosts

Again, everything works as expected except for images not being displayed.

Here is my default.conf file:
=-=-=-=-=-=-=-
upstream web_backend {
server xxx.xxx.xxx.xxa:xxxxa; #Process node1 container -p 80:80
server xxx.xxx.xxx.xxb:xxxxb; #Process node2 container -p 80:80
server xxx.xxx.xxx.xxc:xxxxc; #Process node3 container -p 80:80
}

server {
listen 80;
#root /var/www/html/site1; # used for initial testing no web site on server any more

#location /images/ { # used for initial testing no web site on server any more
# try_files $uri /images/default.gif;
#}

location ~* \.(html|jpg|jpeg|gif|png|css|js|ico|xml)$ {
root /var/www/html/site1/images; # this is the path on Process nodes to images, not sure if this is correct
access_log off;
log_not_found off;
expires 360d;
}

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X­Forwarded­For $proxy_add_x_forwarded_for;
proxy_pass http://web_backend;
}
}
-=-=-=-=-=-=-=

Please let me know if you require any other information.

Thanks,
Starblade
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready