• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Error when changing Nginx configuration

Elicsan

New Pleskian
Hi there,

I have following problem when I try to cange the configuration file for Nginx in Plesk.

Details:
- Using Wordpress
- vServer
- PHP is handled through Nginx
- Memcached is enabled


To use the caching plugin "Cachify" in combination with memcached, the nginx configuration file must be edited.
Following config should be used:

Code:
## GZIP
gzip_static on;
## CHARSET
charset utf-8;
## INDEX LOCATION
location / {
	error_page 405 = @nocache;
 
	if ( $query_string ) {
		return 405;
	}
	if ( $request_method = POST ) {
		return 405;
	}
	if ( $request_uri ~ "/wp-" ) {
		return 405;
	}
	if ( $http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_ ) {
		return 405;
	}
	
	default_type text/html;
	add_header X-Powered-By Cachify;
	set $memcached_key $host$uri;
	memcached_pass localhost:11211;
}
## NOCACHE LOCATION
location @nocache {
	try_files $uri $uri/ /index.php?$args;
}

When I try to save the new config, following error appears:

Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/systemmydomain/conf/vhost_nginx.conf:8 nginx: configuration file /etc/nginx/nginx.conf test failed


How can I use the necessary configuration? I used google before, but some people said, that the server templated needs to be edited?



Thanks in advance!
 
Back
Top