I have 3 Nginx Servers like this -
- lab01.net => 192.168.89.128 (load balancer)
- lab02.net => 192.168.89.129 (backend)
- lab03.net => 192.168.89.130 (backend)
-------------- lab01.net configuration ----------
upstream backend {
server lab02.net:443;
server lab03.net:443;
}
server {
listen 80;
listen [::]:80;
server_name lab01.net;
return 301 https://lab01.net$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name lab01.net;
ssl_certificate /etc/nginx/ssl/ssl.pem;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
location / {
proxy_pass https://backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
}
------------------- lab02.net configuration --------------------------
server {
listen 8080;
listen [::]:8080;
server_name lab02.net;
return 301 https://lab02.net$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name lab02.net;
root /srv/www/en;
index index.html index.htm;
ssl_certificate /etc/nginx/ssl/ssl.pem;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
}
------------------- lab03.net configuration -----------------------
server {
listen 8080;
listen [::]:8080;
server_name lab03.net;
return 301 https://lab03.net$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name lab03.net;
root /srv/www/es;
index index.html index.htm;
ssl_certificate /etc/nginx/ssl/ssl.pem;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
}
Firewalld 8080, HTTP, and HTTPS are allowed on all servers.
Selinux Policy "semanage fcontext -a -t httpd_sys_content_t "/srv/www(/.*)?" is on each lab02.net and lab03.net servers and "setsebool -P httpd_can_network_connect" on lab01.net Nginx load balancer.
All works fine and the problem is that when I load the websites they do not appear correctly. The letters, images, content, etc... are not in a place where they belong to.
When I use just only index.html to test it's just fine but when I use real HTML and CSS template website, the problem starts to appear.