# Apache mod_rewrite exempt + mod_proxy [Solved]

## aztech

Hi

I'm having som troubble with setting up my apache to work with both

mod_rewrite and the proxy module.

The thing is ...

I have a bunch of different webapps on th server and I want to force

all traffic to and from the server to use SSL (https).

I found a way to do that using mod_rewrite ..

Now I've installed Webmin and since webmin is it's own webserver,

I thought I could use the proxy module to proxy a dir to the local service ..

IE ... myserver.com/webmin/ -> myserver(local):10000

I've got the same thing working for AjaxTerm using the proxy mod ..

But I can't get it to work with webmin, even tough I've tried to turn off

webmins own SSL-engine.

default_vhost.conf

```

Listen 80

NameVirtualHost *:80

<VirtualHost *:80>

        ServerName localhost

        Include /etc/apache2/vhosts.d/default_vhost.include

        <IfModule mpm_peruser_module>

                ServerEnvironment apache apache

        </IfModule>

# Redirect to SSL

        RewriteEngine On

        RewriteCond %{HTTPS} !on

        RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]

</VirtualHost>

</IfDefine>

```

default_ssl_vhost.conf (only the case specific part of it .. )

```

ProxyRequests On

       <Proxy *>

                AuthType Basic

                AuthName "remote shell access"

                AuthUserFile /etc/apache2/htpasswd

                Require user aztech

                Order deny,allow

                Allow from all

        </Proxy>

ProxyPass /ajax/ http://localhost:8022/

ProxyPassReverse /ajax/ http://localhost:8022/

ProxyPass /wm/ http://localhost:10000/

ProxyPassReverse /wm/ http://localhost:10000/

```

The latter ProxyPass /wm/ .... is for Webmin and http instead of https because

webmin's SSL is turned off in this example.

I suppose that the reason it does not work with Webmins own SSL stuff, is

that it creates a conflict with Apache's SSL ...

But even if I disable webmin SSL, it does not work.

I get to the login-page, but after that I get ..

```

Not Found

The requested URL /session_login.cgi was not found on this server.

Apache Server at my.server.com Port 443

```

Obviously the real adress is not my.server.com ....

Any ideas ?

Can't figure this on out on my own ...

BR

Andreas

----------

## aztech

If that the goal was to run webmin under apache, was not clear, then I'm sorry.

I found a very handy guide for doing exactly this

Here -> http://doxfer.com/Webmin/UnderApache#Webmin_Proxied_Through_Apache

----------

