Recommened Hosting Setup for NGINX or APACHE?

Who has experience of hosting s2member with Nginx?
What is the most stable setup for S2Member with NGINX?
I am considering running my site in a Docker container and would like to know more about what environment you are testing with.
I would rather replicate what the developers of the plugin are using simplify troubleshooting and development.
If not NGINX then what is the ideal? Verison of PHP, Apache etc.
Any thoughts?

I moved wordpress and s2member from apache to nginx and haven’t experienced a functional difference. I haven’t had to undergo special configuration. It works in dev and live.

You are transitioning from .htaccess to a nginx .conf file.

You may want to review the following resources:
https://codex.wordpress.org/Nginx
https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/

1 Like

Definitely nginx - for s2member specific you need to block access so the s2member-files and s2member-logs directory.

Yes it does take some time to understand how to write your nginx config file - especially should you ever move domain with s2member, but nginx is simply way faster (even though since php 7.2 - I consider php usable again speedwise). Also things like http2 are usually implemented faster and actually easier to setup.

e.g. - The following switch from s2member to optimizemember - would just be a nightmare with PHP in my eyes - even though of course understanding the nginx documentation well enough to set this up took me also over 2 days - but it’s clean and works 100% with nearly no performance loss. The same with PHP in my eyes would be even more difficult and degrade performance (don’t switch to OPM - OPM sucks just as bad as s2member when it comes to reliability - and support is there - but noone can code. This is just an example how awesome nginx is)

location / {

if ( $args ~* "s2member_paypal_notify=1" ) {
set	$args "optimizemember_paypal_notify=1";
rewrite ^.*$ https://www.velomap.org/ permanent; 
} 

if ( $args ~* "s2member_paypal_notify" ) {
set	$args "optimizemember_paypal_notify";
rewrite ^.*$ https://www.velomap.org/ permanent; 
} 

if ( $args ~* "s2member_pro_stripe_notify=1" ) {
set	$args "optimizemember_pro_stripe_notify=1";
rewrite ^.*$ https://www.velomap.org/ permanent;
}

if ( $args ~* "s2member_pro_stripe_notify" ) {
set	$args "optimizemember_pro_stripe_notify";
rewrite ^.*$ https://www.velomap.org/ permanent;
} 

try_files $uri $uri/ /index.php?$args;
}