View Single Post
  #7  
Old 30th December 2012, 17:06
wiebew wiebew is offline
Junior Member
 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default The solution for nginx squirrelmail problems

Hi Falko the problem lies with the settings to be pasted mentioned in the (otherwise very thrustworthy) perfect server tutorial for step 21 at the bottom. My guess is that the SCRIPT_FILENAME is set wrong in the original script

The wrong settings are:
Code:
location /squirrelmail {
       root /usr/share/;
       index index.php index.html index.htm;
       location ~ ^/squirrelmail/(.+\.php)$ {
               try_files $uri =404;
               root /usr/share/;
               fastcgi_pass 127.0.0.1:9000;
               fastcgi_param HTTPS on; # <-- 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 ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
               root /usr/share/;
       }
}
location /webmail {
       rewrite ^/* /squirrelmail last;
}
The good settings are
Code:
location /squirrelmail {
       root /usr/share/;
       index index.php index.html index.htm;
       location ~ ^/squirrelmail/(.+\.php)$ {
               try_files $uri =404;
               root /usr/share/;
               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_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;
       }
       location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
               root /usr/share/;
       }
}
location /webmail {
       rewrite ^/* /squirrelmail last;
}
Reply With Quote