Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Location try_files rewrite syntax

$
0
0
Hi

background: - LEMP stack serving drupal, roundcube, phpmyadmin and postfix/dovecot email server.

Roundcube & phpmyadmin symlinked to the root of the drupal installation

When I disable clean URL's I can access both roundcube and phpmyadmin interfaces by going to

https://mysite.co.uk/roundcube or https://mysite.co.uk/phpmyadmin

However the problem I have arises when I enable clean URL's. I've managed to do so using this tutorial (http://wiki.nginx.org/Drupal) specifically these two config lines : -

location / { try_files $uri @rewrite; } &
location @rewrite { rewrite ^ /index.php; }

with clean urls enabled my drupal site works as expected but when i try to access roundcube or phpmyadmin i get a 404 error message

What is the simplest solution to keep clean urls working and get roundcube and myphpadmin working at the same time?

i've tried to exclude the roundcube & myphpadmin directories from the rewrite and this works to a point

i amended the above two config lines as follows:

location /(!roundcube|phpmyadmin) { try_files $uri @rewrite; }

location @rewrite { rewrite ^ /index.php;

doing this enables clean urls and allows me to access roundcube & phpmyadmin at https://mysite.co.uk/roundcube and https://mysite.co.uk/phpmyadmin however it then requires all subpages of my drupal website to be access with a ? symbol

so https://mysite.co.uk/contact-us becomes https://mysite.co.uk/?contact-us

if anyone has the time to read through the above and has a simple solution to remove the ? then it would be greatly appreciated

thanks

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>