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

Stefan Scott lists at
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 

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

(1) When I browse to 
(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 - 
but it is getting done when I just enter 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;

  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_prefer_server_ciphers   on;

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

server {
  listen     80;
    location / {
    rewrite ^/phpmyadmin(.*)$1 

This seems like it should be straightforward - I just want to serve 
phpMyAdmin from a sub-URL ( instead of from 
a vhost ( 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

More information about the nginx mailing list