• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Apache+Nginx https redirect

Extar93

New Pleskian
Hello! There is a problem with HTTPS. Apache + Nginx PHP mode FPM. CMS: WordPress. When adding a rule redirect to https in the domain configuration file nginx.conf, everything works. But, if you add a rule in the ' Additional directive nginx ' in Plesk Panel the error when connecting to site ' TOO_MANY_REDIRECTS ' how can I fix it?
Additional directive nginx:
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}

Rule redirect
rewrite ^(.*)$ https://site.ru/$1 redirect;
 
Last edited:
If you use Apache + nginx, you don't need these additional nginx directives.

Regards
 
It will.
If you have set in php settings - phpfpm with apache and in server settings - serve static files by nginx, it should work correctly. If you have any problems, open permalink settings in WordPress and apply pretty URLs again, that will set the corect rules in htaccess.

If you set in php settings phpfpm with nginx, then you should add that if rule in additional nginx directives. In this case htaccess file will not be taken in account.
 
It will.
If you have set in php settings - phpfpm with apache and in server settings - serve static files by nginx, it should work correctly. If you have any problems, open permalink settings in WordPress and apply pretty URLs again, that will set the corect rules in htaccess.

If you set in php settings phpfpm with nginx, then you should add that if rule in additional nginx directives. In this case htaccess file will not be taken in account.
Well, thanks for the info.
 
Hi Extar93 and bulent,

If you use Apache + nginx, you don't need these additional nginx directives.
Sorry, but this is incorrect. It's not the fact that you don't NEED it, there might be already a redirection, depending to your domain settings over Plesk, so that using another redirection will cause issues as described in the starting post of this thread.

Additional directive nginx:
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}

Rule redirect
rewrite ^(.*)$ https://site.ru/$1 redirect;

BEFORE you add such an additional directives, please CHECK your current nginx.conf ( or nginx_ip_default.conf ) ( at: "/var/www/vhosts/system/YOUR-DOMAIN.COM/conf/" ) for that specific (sub)domain.
A standard example would look like this in your configuration file:
Code:
    if ($host ~* ^YOUR-DOMAIN.COM$) {
        rewrite ^(.*)$ https://www.YOUR-DOMAIN.COM$1 permanent;
    }


If you would like to use additional directives, please keep in mind, that there are very good FREE extensions for Plesk available:
  1. htaccess to nginx ( Link to the Plesk extension catalogue )
  2. Webserver Configurations Troubleshooter ( available over the Plesk Installer: "Additional Plesk extensions" )
Both extensions help to avoid configuration failures, so it is a wise idea to use them.
 
Hi Extar93 and bulent,


Sorry, but this is incorrect. It's not the fact that you don't NEED it, there might be already a redirection, depending to your domain settings over Plesk, so that using another redirection will cause issues as described in the starting post of this thread.


BEFORE you add such an additional directives, please CHECK your current nginx.conf ( or nginx_ip_default.conf ) ( at: "/var/www/vhosts/system/YOUR-DOMAIN.COM/conf/" ) for that specific (sub)domain.
A standard example would look like this in your configuration file:
Code:
    if ($host ~* ^YOUR-DOMAIN.COM$) {
        rewrite ^(.*)$ https://www.YOUR-DOMAIN.COM$1 permanent;
    }


If you would like to use additional directives, please keep in mind, that there are very good FREE extensions for Plesk available:
  1. htaccess to nginx ( Link to the Plesk extension catalogue )
  2. Webserver Configurations Troubleshooter ( available over the Plesk Installer: "Additional Plesk extensions" )
Both extensions help to avoid configuration failures, so it is a wise idea to use them.
Thank you. Everything worked.
 
Back
Top