Nginx as a reverse proxy dor several internal services and ssl-endpoint

Hello list,
I want to use nginx as a ssl-Endponit and semi-public face to some
internal
wenservicese like trac, nagios and squirrelmail. These services run on
other
(virtual) boxes, nginx shall live in its own (virtual machine).

The web services run (for the time being) under apache2.

I installed the dev version 0.6.29 under ubuntu dapper

My problem is that I cannot reach the backends cleanly. For example I
can see
the nagios front page but the links to the cgis are wrong and lead to
404.

I see the Nagios start page at https://intern.mydomain.de/nagios/ but
when I
click the link to the ‘Tactical overview’ it looks like this

https://intern.mydomain.de/cgi-bin/nagios2/tac.cgi

and leads to a 404

I have a hard time to ‘get’ this rewrite and redirection stuff and see
some
inconsitency in the descriptions here
http://wiki.codemongers.com/NginxHttpProxyModule#proxy_pass

the examples ther use 2 parameters to the proxy_pass statement, but this
leads to syntax errors and it is not clear what it should do at all.

This is the relevant part of the nginx.conf:

server {
listen 443;
server_name intern.mydomain.de
ssl on;
ssl_certificate /etc/nginx/ssl/intern_cert.pem;
ssl_certificate_key /etc/nginx/ssl/intern_private.key;
keepalive_timeout 70;
location / {
root html;
index index.html index.htm;
}
location /nagios/ {

rewrite ^/nagios$ https://intern.projecthome.de/nagios/ break;

makes no difference

  proxy_pass  http://inagios:80/nagios2/;
  proxy_redirect http://inagios:80/nagios2/ /nagios/ ;
 }

}

The proxy parameters are in a separate file and work fine for a ‘trac’
instance.

The apache config for the nagios server is this :

ScriptAlias /cgi-bin/nagios2 /usr/lib/cgi-bin/nagios2
ScriptAlias /nagios2/cgi-bin /usr/lib/cgi-bin/nagios2
Alias /nagios2 /usr/share/nagios2/htdocs
<DirectoryMatch (/usr/share/nagios2/htdocs|/usr/lib/cgi-bin/nagios2)>
Options FollowSymLinks

    AllowOverride AuthConfig
    Order Allow,Deny
    Allow From All

    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios2/htpasswd.users
    require valid-user
------- and the cgi configuration is this (excerpt): ------- url_html_path=/nagios2 -------

Thanks for listening and for nginx itself !

Norbert
[

Hello all,
I found the solution and described it in the wiki.

http://wiki.codemongers.com/NginxProxyNagios

All the best

Norbert