nginx - Squirrelmail - 404 Not found - uBuntu 11.10

Discussion in 'Installation/Configuration' started by sellotape, Dec 10, 2011.

  1. sellotape

    sellotape New Member

    Hi there.

    When I attempt to forward or hit 'Send' to send an e-mail I receive a 404 error message in the right 'mail' frame (the left frame with the folders remains).

    I have a feeling it might have something to do with squirrelmail not talking to nginx properly but I am unsure what steps to take to resolve.


    Thanks

    [​IMG]
     
    Last edited: Dec 10, 2011
  2. sellotape

    sellotape New Member

    I've done a bit of digging and it would appear that there is a problem in the URL...

    http://server1.example.com/squirrelmail/src/compose.php/squirrelmail/src/compose.php?mail_sent=yes

    I haven't got the foggiest why it's replicating the directory in the URL... Any thoughts?
     
  3. falko

    falko Super Moderator

  4. sellotape

    sellotape New Member

    Hi Falko - It does the same even when using the link you specified.

    I think it has something to do with the way Nginx is handling pgp scripts... It is duplicating the directory it is in when attempting to perform an action..

    For instance...

    http://server1.example.com:8081/squirrelmail/src/compose.php/squirrelmail/src/compose.php?mail_sent=yes

    Not figured it out yet... But if anyone knows what is happening please let me know - or if I find out I will post an update here!


    Thanks
     
    Last edited: Dec 11, 2011
  5. falko

    falko Super Moderator

    Can you post your /etc/nginx/nginx.conf?
     
  6. sellotape

    sellotape New Member

    Hi Falko.

    I gave up and did a fresh install with Apache.
    I am no expert using Linux but it's something I like to do in my spare time to enhance my knowledge of running a server!

    HowtoForge has been a brilliant support site for me - thank you to all for your support!


    Please feel free to delete this thread.


    Thanks
     
  7. wiebew

    wiebew New Member

    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;
    }
    
     

Share This Page