LEMP + PhpMyAdmin + SSL

Discussion in 'HOWTO-Related Questions' started by maxxer, Feb 3, 2012.

  1. maxxer

    maxxer Member

    Hi.

    Any idea on how to configure phpmyadmin on https?

    I followed the relative howto, configuring the ssl site as following:
    Code:
    server {
            listen 443 default_server ssl;
            server_name _;
    
            ssl_certificate ssl.crt;
            ssl_certificate_key ssl.key;
    
            ssl_session_timeout 5m;
    	keepalive_timeout    70;
    
            ssl_protocols SSLv3 TLSv1;
            ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
            ssl_prefer_server_ciphers on;
            root /dati/www/management_site;
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to index.html
                    try_files $uri $uri/ /index.html;
            	index index.php index.html;
                root /dati/www/management_site;
            }
    
        ## Images and static content is treated different
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
            access_log        off;
            expires           30d;
            root /dati/www/management_site;
        }
    
        ## Parse all .php file in the /var/www directory
        location ~ .php$ {
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_pass   backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params; 
            fastcgi_intercept_errors        on;
            fastcgi_ignore_client_abort     off;
            fastcgi_connect_timeout 60;
            fastcgi_send_timeout 180;
            fastcgi_read_timeout 180;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
            include /etc/nginx/fastcgi_params;
        }   
    
            location ~ /\.ht {
                    deny all;
            }
    
            location /phpmyadmin {
                   root /usr/share/;
                   index index.php index.html index.htm;
                   location ~ ^/phpmyadmin/(.+\.php)$ {
                           try_files $uri =404;
                           root /usr/share/;
                           fastcgi_pass 127.0.0.1:9000;
                           fastcgi_index index.php;
                           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                           include /etc/nginx/fastcgi_params;
                   }
                   location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                           root /usr/share/;
                   }
            }
    
    }
    
    I reach the login page, but when I press "login" nginx says that an http request was performed on an https port.
    any idea how to fix?
    thanks
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. maxxer

    maxxer Member

  4. falko

    falko Super Moderator Howtoforge Staff

    No, it isn't. You are missing the
    Code:
    fastcgi_param HTTPS on;
    line.
     
  5. maxxer

    maxxer Member

    oh ****, thanks for pointing that out!
    sadly it still behaves the same.
    can it be due to nginx caching?

    thanks
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Can you clear your browser's cache?
     
  7. maxxer

    maxxer Member

    now works, thank you very much!
     

Share This Page