ningx 500 error instead of 404

Discussion in 'Installation/Configuration' started by clip, Oct 11, 2012.

  1. clip

    clip New Member

    Hi,

    I just installed a ningx server with isp config and noticed that my joomla website outputs a 500 error instead of an 404 error not found...

    Is there a way to fix this? And where to start?

    Thanks...
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Any errors in the web site's error log? What configuration do you use in the nginx Directives field on the Options tab of that web site in ISPConfig?
     
  3. clip

    clip New Member

    I moved the site from an apache2 vps server, also isp config. So i had to remove the .htacces file because that was not working on ningx. Is that the erro log before the /web folder?

    Then on the isp config diretives field i have nothing, somehow that field was not working or updating the ningx host file... From isp config.

    I changed the vhost myself to this, because i needed sef... sef is working now... But i do not use a symlink right now, picture added as attachment... Dont know if thats the right way.

    I also wanted to redirect to without www so i set this in isp config, but its not redirecting to without www.

    Code:
    server {
            listen *:80;
    		
            
            server_name mysite.com *.mysite.com;
    
    		error_log /var/log/ispconfig/httpd/mysite.com/error.log;
    
            access_log /var/log/ispconfig/httpd/mysite.com/access.log combined;
    
            root   /var/www/mysite.com/web;
    
            index index.php;
            # Support Clean (aka Search Engine Friendly) URLs
            location / {
                    try_files $uri $uri/ /index.php?q=$request_uri;
            }
    
    		index index.php index.html index.htm default.html default.htm;
    
            # deny running scripts inside writable directories
            location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                    return 403;
                    error_page 403 /403_error.html;
            }
    
            location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
           # caching of files
           location ~* \.(ico|pdf|flv)$ {
                    expires 1y;
           }
    
           location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|otf|woff)$ {
                    expires 14d;
           }
    		
            ## Disable .htaccess and other hidden files
            location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
            }
    		
    		
            location /stats {
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web1/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    		
    
     }       
     

    Attached Files:

    Last edited: Oct 12, 2012
  4. clip

    clip New Member

    Hmmm think i am doing something right now...
    I went to the isp config backend and set auto subdomain to www

    After that i checked the sites enabled folder on my server and saw a new vhost symbolic link... But now starting whit 100 instead of 900

    I went back to the isp config backend and added the needed code for sef and cache in the directives field...

    Code:
     
    
    # Support Clean (aka Search Engine Friendly) URLs
            location / {
                    try_files $uri $uri/ /index.php?q=$request_uri;
    }
    location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                    expires 14d;
            }
    
    After some minutes sef was working agian... :)

    The error 500 is still there but noticed not everywhere... Only on the jomsocial part of the website. So maybe there the problem is...

    For example if i type:

    http://mysite.com/music/something i get >> 404
    On this link there is no jomsocial installed

    But if i type:

    http://mysite.com/somethingwhatisnotthere i get >> 500 Controller

    CommunitySomethingwhatisnotthereController not found!

    On the mainpage i have jomsocial installed

    And then again if i type:

    http://mysite.com/news/something i get >> 404
    On this link there is no jomsocial installed


    So what to do now?
     
  5. falko

    falko Super Moderator ISPConfig Developer

    For Joomla, you need this configuration in the nginx Directives field in ISPConfig:

    Code:
           # deny running scripts inside writable directories
           location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                    return 403;
                    error_page 403 /403_error.html;
           }
    
           location / {
                    try_files $uri $uri/ /index.php?q=$uri&$args;
    
           }
    
           # caching of files
           location ~* \.(ico|pdf|flv)$ {
                    expires 1y;
           }
    
           location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|otf|woff)$ {
                    expires 14d;
           }
     

Share This Page