The Perfect Server - Roundcube Location / PHP is a download

Discussion in 'Server Operation' started by Deex, Jun 21, 2019.

  1. Deex

    Deex New Member

    Greetings, (solved see next Post)

    i installed the Perfect Server with Roundcube and Nginx. I would like to change a domain to the Roundcube HTML docs in /usr/share
    But if i do so and change the Root of the files, it offers me the index.php as Download while /roundcube/ is working.


    server {
            listen *:80;
            listen *:443 ssl;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_certificate /var/www/clients/client0/web1/ssl/;
            ssl_certificate_key /var/www/clients/client0/web1/ssl/;
            server_name ;
            root /usr/share/;
            index index.html index.htm index.php index.cgi index.xhtml;
            error_page 400 /error/400.html;
            error_page 401 /error/401.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 405 /error/405.html;
            error_page 500 /error/500.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            recursive_error_pages on;
            location = /error/400.html {
            location = /error/401.html {
            location = /error/403.html {
            location = /error/404.html {
            location = /error/405.html {
            location = /error/500.html {
            location = /error/502.html {
            location = /error/503.html {
            error_log /var/log/ispconfig/httpd/;
            access_log /var/log/ispconfig/httpd/ combined;
            location ~ /\. {
                deny all;
            location ^~ /.well-known/acme-challenge/ {
                access_log off;
                log_not_found off;
                root /usr/local/ispconfig/interface/acme/;
                autoindex off;
                index index.html;
                try_files $uri $uri/ =404;
            location = /favicon.ico {
                log_not_found off;
                access_log off;
                expires max;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            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/client0/web1/web//stats/.htpasswd_stats;
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            location ~ \.php$ {
                try_files /2fe7602f83abf9bea8089b8a0dc20491.htm @php;
             location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                           root /usr/share/;
              location /{
                   location ~ ^/roundcube/(.+\.php)$ {
                           try_files $uri =404;
                           root /usr/share/;
                           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_FILENAME         $request_filename;
                           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;
                           fastcgi_param   HTTPS                   $https;
                           # PHP only, required if PHP was built with --enable-force-cgi-redirect
                           fastcgi_param   REDIRECT_STATUS         200;
                           # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
                           fastcgi_pass unix:/var/lib/php7.0-fpm/apps.sock;
                           fastcgi_index index.php;
                           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;
    Inside PHP i added the open basedir values
    and also
    php_admin_flag[short_open_tag] = On
    inside the php.ini and web1.conf

    Info PHP files are working but only roundcube is sadly a download. I must missed here something.
    Last edited: Jun 22, 2019
  2. Deex

    Deex New Member

    Okay here the resolution. It's a bit wierd but it was a Chrome Bug with the Cache! While i did setup the VHOST.conf i likely made something wrong and the PHP File was Downloaded in Chrome. For unknown Reason chromes cache was not refreshed within days and he offerd me the Download again and a again. The resolution was to clear Chromes Cache / Use a different browser. I'm not going deeper in chrome and check why in this particular download case chrome dit not refresh the cache.
    till likes this.

Share This Page