• 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.

Advanced nginX directives for a vhost (memcached)

TechnoMan

New Pleskian
You can edit the nginx directives for the desired vhost at the webserver config. However, it seems like that you can only add basic directives, but not something like that:
Code:
http {

	# memcached servers
	upstream memcached-servers {
		server 127.0.0.1:11211;

	}

	# PHP-FPM upstream
	upstream php-fpm {
		server 127.0.0.1:9000;
	}

	server {

		## Listen ports
		listen 80;
		listen [::]:80;

	}
}

How can I do that?

Thanks
 
Memcache can be included as PHP-Extension and then it doesn't need to be configured for NGINX then. If you still insist to pass the requests from one upstream to another one and then back to the client, you loose all the advantages in speed, that you gained by using the NGINX proxy. Be aware that you can't pass the client requests to two upstream at the same time, only one after the other.
The memcache PHP-Extension is already served, when you pass the client requests over the PHP-FPM upstream.
 
Ah i see. But how can you do that in general? There are man other advanced nginX directives that won't be accepted in the panel.
 
Well, "won't be accepted" are the wrong words I think, because the integrated nginx-configuration-checker just checks, if your inputs are valid and if not, it will point to the line, where mistakes/problems/mis-configurations are beginning. As mentioned in your starting post, you cant't put "server" - directives in a "vhost" - directive... so the checker will indeed tell you, that this doesn't work. ^^ IF you really want to change a server directive, you could do this directly under "/etc/nginx/nginx.conf".
 
Back
Top