XF 1.4 Nginx Friendly URLs

Sambish

Member
Hello,

I recently took the chance to move my current site from Apache over to Nginx. So far the installation has gone smoothly and everything is working but one thing: Friendly URLs. I understand that on Apache you'd use a .htaccess file to complete this, but on Nginx it is different. I feel as something is configured wrong, or I have placed this content in the wrong file. At /etc/nginx/sites-available/default I have the following config. Any ideas as to why it doesn't work?

Thanks,
Sam.
 
I don't actually see any part of the recommended config in the config that you provided. You have a try_files line, but it's different from what's needed (it doesn't try index.php).
 
try this in /etc/nginx/conf.d/yourdomain.conf

Code:
location /xf/ {
    try_files $uri $uri/ /xf/index.php?$uri&$args;
    index index.php index.html;
}

location /xf/install/data/ {
    internal;
}
location /xf/install/templates/ {
    internal;
}
location /xf/internal_data/ {
    internal;
}
location /xf/library/ {
    internal;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass    127.0.0.1:9000;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include         fastcgi_params;
}
 
Top Bottom