Support

Admin Tools

#38229 Nginx home page sef link

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.2.5
PHP version
8.1.3
Admin Tools version
7.2.0

Latest post by nicholas on Monday, 26 December 2022 06:27 CST

activha

Hi Nicholas

I am moving from apache joomla 3 to nginx joomla 4 server and used your nginx config tool.

Everything went fine except for the home page when I use the server front end protection setting.

In this case the / home page is always redirects to index.php? 

The other languages home pages works fine for instance /en/ is ok (the website is in fr by default)

All other links are fine and I use this as code block :

try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;

 

when deactivating the server front end protection setting then the / home page works correctly again.

I am a little stuck on debugging this.

Seems like it can come from these last lines :

# Allow access to /
location ~* ^/$ {
	return 301 /index.php?$args;
}

# Disable access to everything else.
location ~* ^/.*$ {
	# If it is a file, directory or symlink and I haven't deliberately
	# enabled access to it, forbid any access to it!
	if (-e $request_filename) {
		return 403;
	}
	# In any other case, just treat as a SEF URL
	try_files $uri $uri/ /index.php?$args;
}

Do you have any idea about this ?

 

Thanks and merry Christmas 

BR

Jean

nicholas
Akeeba Staff
Manager

Good morning and Merry Christmas!

You forgot to turn on the option “Enable SEF URLs” in the NginX Config Maker's page.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

activha

Of course not 😁

it’s activated and working fine, but only when Frontend protection is deactivated. 

if activated I get the index.php? But only for the main language front page. 
Every other urls is correctly SEFed

 

nicholas
Akeeba Staff
Manager

I am looking at this history of the first location block (which is what does that redirection). Unfortunately, it cannot be removed. Removing it makes it impossible to block access to subdirectories.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

activha

Too bad we cannot use frontend protection in this case :-(

Any idea of a workaround ?

nicholas
Akeeba Staff
Manager

If I had a workaround wouldn't I have already implemented it years ago? :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!