Nginx proxy pass not rendering

820 Views Asked by At

I'm trying to serve some services as a subdomain but it looks like nginx is not doing it right. I have 3 docker containers serving zabbix, webmin and mediawiki.

  • example.com/zabbix (works fine)
  • example.com/webmin (not rendering)
  • example.com/wiki (not rendering)
server {
    listen 80;
    server_name             example.com;
    root                    /var/www/html/;
    

    location /zabbix {
        proxy_pass          http://192.168.0.71:8081;
        proxy_set_header    Host                $host;
        proxy_set_header    X-Real-IP           $remote_addr;
        proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    }

    location /wiki {
        proxy_pass         http://192.168.0.71:8080;
        proxy_set_header   Host                 $host;
        proxy_set_header   X-Real-IP            $remote_addr;
        proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
    }
    location /webmin {
        proxy_pass         http://192.168.0.71:10000;
        proxy_set_header   Host                 $host;
        proxy_set_header   X-Real-IP            $remote_addr;
        proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
    }

}

Also add in /etc/webmin/config:

webprefix=/webmin
webprefixnoredir=1

and LocalSettings.php

$wgServer = "http://example.com";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;

wiki pages and webmin looks weird: wiki screenshot

Any help will be appreciated thanks!

0

There are 0 best solutions below