Cleared Firefox's disk cache to stop "downloading" index.php

Stefan Scott lists at ruby-forum.com
Sat Feb 14 07:59:40 MSK 2009


Stefan Scott wrote:

> (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.

This is fixed now. I had fixed the nginx.conf file and the problem kept 
on happening - till I realized that Firefox was saving the index.php 
file in its disk cache, and therefore offering to download it (before 
giving nginx a chance to rewrite the http to https!).

I cleared the cache, and now when I open:

http://mydom.myhost.com/myphpadmin/index.php

it rewrites to https:

http://mydom.myhost.com/myphpadmin/index.php

and Firefox renders index.php rather than trying to download it.


Regarding the other issue (labeled (2) in my earlier post), where some 
img graphics are missing, that's still happening.

This img graphic in the source of the main frame on the phpMyAdmin main 
page (having a relative path starting with "js") is getting lost:

img id="myRainbow" src="js/mooRainbow/images/rainbow.png"

But other files in the same frame specified using a different kind of 
path (having a pathname starting with a ".") seem to be fine:

img class="icon" src="./themes/original/img/s_host.png"

I probably need another 'location' block to serve static files. The "." 
in the second pathname refers to the phpMyAdmin home directory, and 
nginx is able to find this graphic - but it's currently unable to find 
graphic whose pathname starts with the relative reference "js". I'm also 
doing:

tail /usr/local/nginx/logs/phpmyadmin.access_log

to try to see exactly what URLs the browser is trying to GET.


Here's my nginx.conf:

  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;
      include /usr/local/nginx/conf/fastcgi_params.phpmyadmin;
      }
  }

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

And here's fastcgi_params.phpmyadmin:

fastcgi_index  index.php;
fastcgi_pass   127.0.0.1:9000;

fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param  HTTPS on;

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

- Stefan Scott



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





More information about the nginx mailing list