1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Avatar 404 error

Discussion in 'Troubleshooting and Problems' started by zastavra, Sep 6, 2014.

  1. zastavra

    zastavra Formally Stevez

    Hello,

    The URL domain.com/account/avatar returns 404 Not Found. There is nothing related in server logs though.

    Any help solving this please.
     
  2. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    what happens when you go to domain.com/index.php?account/avatar ?
    If you can see the page, I am guessing you either haven't copied XenForo's .htaccess to server's root or your server's Apache does not have mod_rewrite support.
     
    zastavra likes this.
  3. zastavra

    zastavra Formally Stevez

    This works.
    I use nginx. All the other URL rewrites work fine.
     
  4. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    Can you post your server block here?
     
  5. zastavra

    zastavra Formally Stevez

    Sure.
    Code:
        server {
            listen                    80;
            server_name                domain.com www.domain.com;
            return 301                https://domain.com$request_uri;
        }
    
        server {
            listen                    443 ssl spdy;
            root                    /www/domain.com/public_html;
            index                    index.php index.html;
            ssl                        on;
            * rest of ssl conf *
           
            if ($host = 'www.domain.com' ) {
             rewrite  ^/(.*)$  https://domain.com/$1  permanent;
          }
         
        location / {
            try_files $uri $uri/ /index.php?$uri&$args;
        }
    
        location /data {
            internal;
            }
    
        location /internal_data {
            internal;
        }
    
        location /library {
            internal;
        }
       
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }
    
        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
    
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires 365d;
            log_not_found off;
        }
    
        location ~ /\. {
            deny    all;
        }
    
        location ~* /(?:uploads|files)/.*\.php$ {
            deny    all;
        }
    
        location ~*     ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
            access_log off;        log_not_found off; expires max;
        }
       
        location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
            expires max; log_not_found off; access_log off;
        }
    
        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/run/php5-fpm.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;
    
            fastcgi_buffer_size 128k;
            fastcgi_buffers 256 16k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
            fastcgi_read_timeout 240;
        }
       
        gzip            on;
        gzip_disable    "msie6";
        gzip_vary        on;
        gzip_proxied    any;
        gzip_comp_level    6;
        gzip_buffers    16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css text/javascript text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss application/atom+xml application/rdf+  application/rdf+xml;
    }
     
  6. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    the location /data should not be set as internal as it is public facing. And I don't see any error.

    btw, the 404 that is being returned, is it from XenForo or from nginx?
     
    zastavra likes this.
  7. zastavra

    zastavra Formally Stevez

    It's from nginx.

    screenshot-09-06 12-37-15.png
     
  8. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    okay so the URL is not getting passed to XenForo for some reason... don't know why.
    Remove
    Code:
    try_files $uri =404;
    from the 'location ~ \.php$' block and see what happens.
     
  9. zastavra

    zastavra Formally Stevez

    Nothing. Still the same.
     
  10. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    okay, I'm officially out of ideas :oops:

    last try from me: remove/comment out
    Code:
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    
    btw, I kept mine pretty simple and no error of any kind:
    Code:
    location ~ \.php$ {
       fastcgi_keep_conn on;
       fastcgi_index index.php;
    
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
    
       fastcgi_pass unix:/var/run/php5-fpm-$username.sock;
    }
    
     
    zastavra likes this.
  11. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    oh... and turn off 'fastcgi_intercept_errors'.
     
    zastavra likes this.
  12. zastavra

    zastavra Formally Stevez

    I've replaced mine with yours.
    Restarted nginx
    Restarted php5-fpm
    Restarted nginx again.
    Still nothing.

    I'm banging my head up against the wall entire day. :/
     
  13. Kostiksnz

    Kostiksnz Member

    How u fix that? I'm migrate to Nginx and have this trouble too!
    Only avatars not working.
     
  14. Sheratan

    Sheratan Well-Known Member

    Post your nginx configuration in here
     
  15. Kostiksnz

    Kostiksnz Member

    Code:
    server {
    listen *:80; ## listen for ipv4
    server_name forum.domain.ru www.forum.domain.ru;
    access_log /var/log/nginx/forum.log;
    root /ssd/var/www/xenforo.domain.ru/html;
    index   index.php index.html;
    
    location / {
            try_files $uri $uri/ /index.php?$uri&$args;
        }
    
        location ~ /(internal_data|library) {
            internal;
        }
    
        location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf)$ {
            access_log  off;
        }
    
        location ~ \.php$ {
           fastcgi_split_path_info ^(.+\.php)(/.+)$;
            try_files $uri =404;
    
            fastcgi_pass    unix:/var/run/fastcgi_sock;
            fastcgi_index    index.php;
            fastcgi_param    SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include    fastcgi_params;
        }
    
    }
    
     
  16. Sheratan

    Sheratan Well-Known Member

    Any php or nginx error log?
     
  17. Kostiksnz

    Kostiksnz Member

    No in logs nothing =(

    tail -f forum.log when open avatar change link - not view anything
    (sorry for my eng)
     
  18. Sheratan

    Sheratan Well-Known Member

    Are you in basedir protection?
    What about chown and chmod?
    Can you run basic php script like phpinfo?
     
  19. Kostiksnz

    Kostiksnz Member

    i'm find how fix that
    in templates:
    account_personal_details
    member_view
    navigation_visitor_tab

    Code:
    xen:link account/avatar 

    replace to
    Code:
    xen:link account/avatar/
    just add /
     

Share This Page