Works - but loses some graphics, and non-SSL saves index.php

Stefan Scott lists at ruby-forum.com
Sat Feb 14 06:06:38 MSK 2009


Hi -

Thanks @Jim - I am using php-fcgi - you'll see it in the nginx.conf file 
below.

The nginx.conf file shown below now works in most cases - except for two 
nagging problems:

(1) When I browse to http://mydom.myhost.com/phpmyadmin/index.php 
(non-SSL protocol, with the index.php file explicitly provided), then 
instead of rewriting http -> https and rendering index.php in the 
browser, it displays a dialog offering to *save* the index.php file.

The http->https rewrite in the server listening at port 80 isn't getting 
done when I enter a URL http://mydom.myhost.com/phpmyadmin/index.php - 
but it is getting done when I just enter 
http://mydom.myhost.com/phpmyadmin. I don't know why - I thought 
"location /" matched *all* queries.

(2) Certain graphics on the main page of phpMyAdmin are missing - for 
example, the "Rainbow" graphic next to the Custom Color button (img 
id="myRainbow" src="js/mooRainbow/images/rainbow.png") .

Here's the nginx.conf file:
server {
  listen 443;
  server_name mydom.myhost.com;

  ssl                 on;
  ssl_certificate     /etc/ssl/certs/myssl.crt;
  ssl_certificate_key /etc/ssl/private/myssl.key;

  access_log /usr/local/nginx/logs/phpmyadmin.access_log;
  error_log  /usr/local/nginx/logs/phpmyadmin.error_log;

  ssl_session_timeout  5m;

  ssl_protocols  SSLv2 SSLv3 TLSv1;
  ssl_ciphers 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  ssl_prefer_server_ciphers   on;

  location /phpmyadmin/ {
    root /home/myname/sources/;
    index index.php;
    fastcgi_index index.php;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS on;
    include /usr/local/nginx/conf/fastcgi_params.phpmyadmin;
    }
}

server {
  listen     80;
  server_name myhost.mydom.com;
    location / {
    rewrite ^/phpmyadmin(.*) https://myhost.mydom.com/phpmyadmin$1 
permanent;
  }
}

This seems like it should be straightforward - I just want to serve 
phpMyAdmin from a sub-URL (mydom.myhost.com/phpmyadmin) instead of from 
a vhost (phpmyadmin.mydom.myhost.com) And I want to use SSL. (Actually I 
really just want to use SSL on the POST on the login page - but I 
haven't figured out how to shut off SSL for the other pages yet - which 
is gonna be a whole 'nother can of worms I guess.)

Thanks for any help.

- Stefan Scott

-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list