Joomla with Nginx Rewrite SEF url Joomla with Nginx Rewrite SEF url nginx nginx

Joomla with Nginx Rewrite SEF url


Yes - this reply is over 3 years old, but, unfortunately, the same problem exists on the latest version of Joomla when using NGINX...

We had the exact same problem on one of our client's sites. The problem turned out to be related to one of PHP's $_SERVER constants not being set by the NGINX server - and that constant (which is `$_SERVER['PHP_SELF']) is used in many places in Joomla to return the current URL. We have described, in details, the problem and how to fix it, here.


if you're using subfolder / virtual hosts, try changing:

# Support Clean (aka Search Engine Friendly) URLslocation / {        try_files $uri $uri/ /index.php?q=$request_uri;}

To

# Support Clean (aka Search Engine Friendly) URLslocation /subfolder/ {        try_files $uri $uri/ /subfolder/index.php?q=$request_uri;}


Hello this is my host configuration, wich is working fine with with Joomla 3.6.5 friendly URLs, Ubuntu 16.04 , PHP7 and nginx:

server {        listen 80;        server_name mydomain.com;        root /var/www/html/mydomain;        index index.php index.html index.htm default.html default.htm;        location / {                try_files $uri $uri/ /index.php?$args;        }        location ~ \.php$ {                include fastcgi_params;                fastcgi_index index.php;                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;        }}