<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    You might want to try:<br>
    <div dir="ltr" class="mw-geshi" style="text-align: left;">
      <div class="nginx source-nginx">
        <pre class="de1"><a href="http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header"><span class="kw21">proxy_set_header</span></a> Host <span class="re0">$http_host</span><span class="sy0">;

in your proxy.conf.

-Umesh
</span></pre>
      </div>
    </div>
    <br>
    On 07/13/2011 01:19 PM, Gelonida wrote:
    <blockquote cite="mid:ivkk30$jfh$1@dough.gmane.org" type="cite">
      <pre wrap="">Hi,

I'm just starting to use nginx.
I'm not sure, whether my nginx configuration is wrong or
whether there are some parameters do be changed in phpmyadmin, such, 
that it works well behind a reverse proxy.

Currently phpmyadmin is running on apache.

What I wanted to do is use nginx (https) as front end
and use it to serve all the static contents

and keep apache (for the time being) for the php contents


The nginx config  I use is:

     location /phpmyadmin {
         alias /usr/share/phpmyadmin/;
         index index.php;
     }
     location ~ .php$ {
         # Use apache for the time being
         proxy_pass <a class="moz-txt-link-freetext" href="http://127.0.0.1:8080">http://127.0.0.1:8080</a>;
         include proxy.conf;
     }

     location / {
         root   /var/www;
         index  index.html index.htm;
     }


my apache configuration is
Alias /phpmyadmin /usr/share/phpmyadmin


I tested phpmyadmin after reconfigring apache
<a class="moz-txt-link-freetext" href="http://hostname:8080/phpmyadmin">http://hostname:8080/phpmyadmin</a>


When running behind nginx following happens:
- I get the login screen
- I enter user name and password
- I am redirected to
<a class="moz-txt-link-freetext" href="http://hostname:8080/index.php">http://hostname:8080/index.php</a>?...
instead of <a class="moz-txt-link-freetext" href="http://hostname/index.php">http://hostname/index.php</a>?... thus
the browser tries connect directly to the ptoxied server.

This will stop working as soon as I let listen apache only on the localhost.

forther I'd like to give access to phpmyadmin only via https:


What are the parameters, that I have to modify
in nginx (or phpmyadmin) to make my setup work.

Thanks in advance for your help.







_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://nginx.org/mailman/listinfo/nginx">http://nginx.org/mailman/listinfo/nginx</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>