phpmyadmin on apache behind https nginx

Gelonida gelonida at gmail.com
Thu Jul 14 00:36:43 MSD 2011


Thanks Umesh,

Somehow I'm still stuck.

This is what I have now:
For testing I try to proxy all accesses to apache.
and I removed the include statement and
inserted all params explicitely

    location / {
         proxy_pass http://127.0.0.1:8080/;
         proxy_redirect http://127.0.0.1:8080/ 
https://aa$host:$server_port/;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

         index  index.html index.htm index.php;
     }

with this setting its still
http://myserver/phpmyadmin/... becomes
http://myserver:8080/phpmyadmin/...


Still searching in the web whether I find any other idea.


On 7/13/2011 9:07 PM, Umesh Sirsiwal wrote:
> You might want to take a look at:
> http://wiki.nginx.org/HttpProxyModule#proxy_redirect
>
>
> On 07/13/2011 02:53 PM, Gelonida wrote:
>> Hi Jim,
>>
>> Thanks for your answer,
>>
>> On 7/13/2011 8:27 PM, Jim Ohlstein wrote:
>>> server {
>>> ...
>>> listen 80;
>>> ...
>>> location /phpmyadmin {
>>> rewrite ^ https://yourhost$request_uri? permanent;
>>> ...
>>> }
>>> ...
>>> }
>> OK if I add above location rule in my http server,
>> then all phpmyadmin requests on my http server will be redirected to my
>> nginx https server.
>> I learnt something new. :-) ( Never used rewrite rules so far )
>>
>> However my main problem is that
>> I enter https://hostname/phpmyadmin/index.php in my browser
>> and that phpmyadmin issues 301 with
>> http://hostname:8080
>>
>> the hostname is substituted correctly, but the protocol and the port
>> number are the ones from my proxy_pass command.
>>
>> proxy_pass http://127.0.0.1:8080
>>
>>
>>
>> Perhaps this problem disappears if I would use fastcgi.
>> However the current php version installed on my server wasn't compiled
>> with the cgi option :-(
>>
>>
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>





More information about the nginx mailing list