• 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question How to set Nginx try_files directive on a domain?

Martin Allen

New Pleskian
We have an issue with a Joomla website that is being hosted on CentOS Linux 7.3.1611 with Plesk Onyx Version 17.5.3 - the site is displaying issues when using nginx as a proxy - when we try tro access the domain https://example.com/administrator we are receiving a nginx 502 Bad Gateway error.
If we access https://example.com/administrator/ (with the trailing slash) then it all works as expected, and I now believe the issue is the rewriting of URI.

When running with just Apache, obviously the .htacess rules are set to rewrite the URI correctly. However as nginx is handling it now I believe I need to add a try_files directive to get this to work correctly. However I cannot see where to add this. I have read multiple posts all of which seem to suggest conflicting ways of setting this but always seem to be followed by people saaying not to add the directive in the fashion that is suggested, or that it doesn't work!!

So how (and what) should I be adding to sort this problem??
 
Back
Top