Let's Encrypt and Roundcube/phpMyAdmin

Discussion in 'Installation/Configuration' started by mmdollar, Oct 20, 2016.

  1. mmdollar

    mmdollar Member

    Hello after I updated my servers to 3.1 and installed Let's Encrypt I can no longer view the images/design of Roundcube (forced SSL) everything looks like this:
    [​IMG]
    This is my nginx directive to access roundcube:
    Code:
    server {
            listen *:80;
    
            listen *:443 ssl;
                    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_certificate /var/www/clients/client5/web3/ssl/domain.pw.crt;
            ssl_certificate_key /var/www/clients/client5/web3/ssl/domain.pw.key;
    
            server_name domain.pw www.domain.pw;
    
            root   /var/www/domain.pw/web/;
    
    
    
            index index.html index.htm index.php index.cgi index.pl index.xhtml;
    
    
            location ~ \.shtml$ {
                ssi on;
            }
    
    
            error_log /var/log/ispconfig/httpd/domain.pw/error.log;
            access_log /var/log/ispconfig/httpd/domain.pw/access.log combined;
    
            location ~ /\.(?!well-known/acme-challenge/) {
                deny all;
                access_log off;
                log_not_found off;
            }
    
            location = /favicon.ico {
                log_not_found off;
                access_log off;
            }
    
            location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
            }
    
            location /stats/ {
    
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client5/web3/web/stats/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /b9091949d7690cbf27e6ccc7dde31635.htm @php;
            }
    
            location @php {
                try_files $uri =404;
    include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php5-fpm/web3.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
            location /cgi-bin/ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                root /var/www/clients/client5/web3;
                gzip off;
                fastcgi_pass  unix:/var/run/fcgiwrap.socket;
                fastcgi_index index.cgi;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
            location /phpmyadmin {
                           root /usr/share/;
                           index index.php index.html index.htm;
                           location ~ ^/phpmyadmin/(.+\.php)$ {
                                   try_files $uri =404;
                                   root /usr/share/;
                                   fastcgi_pass unix:/var/run/php5-fpm.sock;
                                   fastcgi_param HTTPS $https; # <-- add this line
                                   fastcgi_index index.php;
                                   fastcgi_param SCRIPT_FILENAME $request_filename;
                                   include /etc/nginx/fastcgi_params;
                                   fastcgi_param PATH_INFO $fastcgi_script_name;
                                   fastcgi_buffer_size 128k;
                                   fastcgi_buffers 256 4k;
                                   fastcgi_busy_buffers_size 256k;
                                   fastcgi_temp_file_write_size 256k;
                                   fastcgi_intercept_errors on;
                           }
                           location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                                   root /usr/share/;
                           }
            }
            location /phpMyAdmin {
                           rewrite ^/* /phpmyadmin last;
            }
    
    
            location ~ /\.well-known/acme-challenge/ {
               root /usr/local/ispconfig/interface/acme/;
               index index.html index.htm;
               try_files $uri =404;
            }
    
            location /roundcube {
             root /usr/share/;
             index index.php index.html index.htm;
             location ~ (.+\.php)$ {
                        try_files $uri =404;
                        include /etc/nginx/fastcgi_params;
                        # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
      #fastcgi_pass 127.0.0.1:9000;
                        fastcgi_pass unix:/var/run/php5-fpm.sock;
                        fastcgi_index index.php;
                        fastcgi_intercept_errors on;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        fastcgi_buffer_size 128k;
                        fastcgi_buffers 256 4k;
                        fastcgi_busy_buffers_size 256k;
                        fastcgi_temp_file_write_size 256k;
             }
             location ~* /.svn/ {
                         deny all;
             }
             location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
                         deny all;
             }
    }
    location /webmail {
             rewrite ^ /roundcube last;
    }
    
            location / {
                    try_files $uri $uri/ /index.php?$args;
           }
    
           # Add trailing slash to */wp-admin requests.
           rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
           location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                    expires max;
    log_not_found off;
           }
    }
    
    
    Do I need somewhere to generate SSL certs for roundcube and phpmyadmin? If I logged to phpmyadmin it just redirects me to the main website. (because I am using the same cert as the main website?)

    Update:
    I have managed to fix the roundcube issue, I needed to add:
    Code:
    location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /var/lib/;
    }
    In location /roundcube block. But I still cannot fix the phpmyadmin problem. Looking for answers will update if I find anything.
     
    Last edited: Oct 20, 2016

Share This Page