• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question nginx rewrites

andyxyz

Basic Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
Version 18.0.61 Update #6
I am trying to do a very simple removal of index.php from a url using nginx only config.

eg


The standard code

location ~* ^/index\.php/(.*)$ { return 301 /$1;}
has no effect in Additional nginx settings and has to be placed within the server block .. which of course will not survive a rebuild.
this seems a spectacularly straight forward request.. how are people doing this?
 
Not sure why you would need a custom template for this. Any Nginx directive you add to the Additional Nginx directive gets added to the server block already.

Most common directive for beautifying links/permalinks look something like:
NGINX:
location / {
            try_files $uri $uri/ /index.php?$args;
}
The exact implementation depends on your website/application.
 
Not sure why you would need a custom template for this. Any Nginx directive you add to the Additional Nginx directive gets added to the server block already.

Most common directive for beautifying links/permalinks look something like:
NGINX:
location / {
            try_files $uri $uri/ /index.php?$args;
}
The exact implementation depends on your website/application.
Tried that 1st.. no effect at all.
 
Back
Top