Author Topic: Nginx Permalinks and forced SSL for all domains with WordPress  (Read 14057 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
1. Go WebServer Settings > Select WebServers and select Nginx Only.
2. Go PHP Settings > PHP-FPM Selector and choose PHP-FPM latest version (mine is 7.3)
3. cd /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/nginx/php-fpm and edit force-https.stpl and default.stpl default.tpl and add into the / block
     location / {
           ......lots of stuff....
           # WordPress permalinks in Nginx
           try_files $uri $uri/ /index.php?$args;
                ......lots of stuff....
        }

4. Go WebServers Settings > WebServers Main Conf and select PHP-FPM, force-https, 7.3, force-https and default. Rebuild all hosts.
5. Go check in /etc/nginx/conf.d/vhosts/ that your domains have the try_files clause.
6. Hit your domain on http and it should re-direct to https. Click a menu item (not home page) and it should bring up the correct page instead of a 404.
7. Permalinks now work. /page/
8. If you update CWP version then you have to do all this again. I can do it in a couple of minutes now after updating.


Offline
*
Re: Nginx Permalinks and forced SSL for all domains with WordPress
« Reply #1 on: July 28, 2019, 06:54:19 AM »
Also add the below code before the first location block.

return 301 https://$server_name$request_uri;

Offline
**
Re: Nginx Permalinks and forced SSL for all domains with WordPress
« Reply #2 on: November 07, 2019, 03:35:20 AM »
PROBLEM SOLVED

Hi, i discovered a great website https://www.mysterydata.com/ with a great administrator where you can find many guides for CWP and more, also by registering for free on the forum i found the solution to this problem thanks to the courtesy and extreme availability of the administrator.

SOLUTION:

https://forum.mysterydata.com/topic/3/cwp-nginx-varnish-apache-with-php-fpm-server-how-to-configure-pretty-permalink-for-wordpress/2

Good day and good work to all !


« Stay hungry, stay foolish. »