XF 1.5 Full Friendly URLs - Error Help!

ENF

Well-known member
You can drop the full relative path.
usr/share/nginx/html/ - do that for each line and it should work.
Code:
location / {
   try_files $uri $uri/ //index.php?$uri&$args;
   index index.php index.html;
  }

  location /install/data/ {
   internal;
  }
  location /install/templates/ {
   internal;
  }
  location /internal_data/ {
   internal;
  }
  location /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;
  }
}
I just fixed someone's install of NGINX, he did the same thing.
 
Last edited:

Dwight

New member
You can drop the full relative path.
usr/share/nginx/html/ - do that for each line and it should work.
Code:
  location / {
   try_files $uri $uri/ /index.php?$uri&$args;
   index index.php index.html;
  }

  location /install/data/ {
   internal;
  }
  location /install/templates/ {
   internal;
  }
  location /internal_data/ {
   internal;
  }
  location /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;
  }
}
I just fixed someone's install of NGINX, he did the same thing.
This didn't do anything. In fact, by removing all the paths, I got an error when restarting Nginx, because the first 2 lines can't have empty paths.

Any other ideas? :S
 

ENF

Well-known member
This didn't do anything. In fact, by removing all the paths, I got an error when restarting Nginx, because the first 2 lines can't have empty paths.

Any other ideas? :S
No idea, below is a copy of my Nginx config for that section and it works fine. (XF is install in the root folder of the site, so the path is '/' for this particular usage.) Then, I just add XF's required directories as they state in the instructions. You have your root folder set the same way as mine, so the paths are correct... you don't have XF in subdirectory, right? -- It's install the 'html' folder, yes?

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

location /install/data/ {
        internal;
}
location /install/templates/ {
        internal;
}
location /internal_data/ {
        internal;
}
location /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;
}
Are the other location entries in your config file the default settings?
 

Dwight

New member
No idea, below is a copy of my Nginx config for that section and it works fine. (XF is install in the root folder of the site, so the path is '/' for this particular usage.) Then, I just add XF's required directories as they state in the instructions. You have your root folder set the same way as mine, so the paths are correct... you don't have XF in subdirectory, right? -- It's install the 'html' folder, yes?

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

location /install/data/ {
        internal;
}
location /install/templates/ {
        internal;
}
location /internal_data/ {
        internal;
}
location /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;
}
Are the other location entries in your config file the default settings?
Ahhh, I see in my config I also had this:
Code:
  location / {
    try_files $uri $uri/ =404;
  }
When Xenforo requires this:
Code:
  location ~ \.php$ {
    try_files $uri =404;
Just to be clear, I should be using Xenforo's, right? So removing what I already did shouldn't be an issue?

Thanks though!
 

ENF

Well-known member
Just to be clear, I should be using Xenforo's, right? So removing what I already did shouldn't be an issue?
I don't see why removing would cause harm. Definitely should use XF's setting, unless you have something special setup, which it appears you don't... (Based on that conf file)

Let us know your next results.
 

Mike

XenForo developer
Staff member
Ahhh, I see in my config I also had this:
Code:
  location / {
    try_files $uri $uri/ =404;
  }
When Xenforo requires this:
Code:
  location ~ \.php$ {
    try_files $uri =404;
Just to be clear, I should be using Xenforo's, right? So removing what I already did shouldn't be an issue?

Thanks though!
The blocks you've pointed out are different; you would likely always need the .php block. However, your issue is that your / location block is overriding XF's / location block; you need to use XF's version of that.
 
  • Like
Reactions: ENF
Top