• 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

zastavra

Formally Stevez
#1
Hello,

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

Any help solving this please.
 

Mr. Goodie2Shoes

Well-known member
#2
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

Formally Stevez
#5
Can you post your server block here?
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;
}
 

Mr. Goodie2Shoes

Well-known member
#6
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?
 

Mr. Goodie2Shoes

Well-known member
#8
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.
 

Mr. Goodie2Shoes

Well-known member
#10
Nothing. Still the same.
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;
}
 
#15
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;
    }

}
 
#19
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 /