Author Topic: Just Nginx run (wordpress permalink 404)  (Read 25474 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Just Nginx run (wordpress permalink 404)
« on: April 10, 2019, 10:37:04 PM »
Hello all,

I m using WordPress latest version.  When i, change my web server like, Ngnix, i got 404 Error on my urls ?

What should i do ?

Thanks.

Offline
*****
Re: Just Nginx run (wordpress permalink 404)
« Reply #1 on: April 12, 2019, 10:50:13 AM »
Hi, you have to edit nginx Vhost configuration file and add the redirects.
The .htaccess does not work with nginx.
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
**
Re: Just Nginx run (wordpress permalink 404)
« Reply #2 on: November 07, 2019, 03:36:33 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. »

Offline
*
Re: Just Nginx run (wordpress permalink 404)
« Reply #3 on: March 28, 2020, 06:41:34 PM »
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 !

Hi,

I have the same issue but for subdomain sites only.

.htaccess is in the subdomain folder but nothing happens.

Another hand there is a line in nginx subdomain vhost that disable .htaccess but is not present in nginx default .conf

Code: [Select]
location ~* "/\.(htaccess|htpasswd)$" {deny all;return 404;}

How did you do it?

Thanks in advance

Offline
****
Re: Just Nginx run (wordpress permalink 404)
« Reply #4 on: March 28, 2020, 06:58:30 PM »
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 !

Hi,

I have the same issue but for subdomain sites only.

.htaccess is in the subdomain folder but nothing happens.

Another hand there is a line in nginx subdomain vhost that disable .htaccess but is not present in nginx default .conf

Code: [Select]
location ~* "/\.(htaccess|htpasswd)$" {deny all;return 404;}

How did you do it?

Thanks in advance

nginx does not use .htaccess file.

Follow these Steps
1)  Log into the CLI via SSH
2)  Cd /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/nginx/php-fpm
3) "   cp default.stpl wordpress.stpl  "  and   "   cp default.tpl  wordpress.tpl     "
4)  edit wordpress.stpl and wordpress.tpl (nano/vi)
5) Find location / {
6)  Immediately under that line add  "     try_files $uri $uri/ /index.php?$args;       "  and save it
7)  Log into CWP Admin panel
8)  Webservers -> Webservrs Domain Config
9)  Select user of domain running wordpress
10) Click Create Configuration
11)  Select NGINX-PHPFPM
12)  Nginx default vhost template type:  Set to PHP-FPM
13)  Nginx default vhost template:   Select Wordpress
14) Select your desired PHP-FPM Version
15) Check box to rebuild Webserver Config for domain.
16) Click Save

Wordpress should now work
 Repear 9-16 for other wordpress installations.
« Last Edit: March 28, 2020, 07:00:21 PM by rcschaff »
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Just Nginx run (wordpress permalink 404)
« Reply #5 on: March 28, 2020, 07:04:36 PM »
Hi rcschaff. Thanks, for answer

I have magento websites also. That will not affect the sites with magento? Excuse my ignorance but it is the first time in my professional life that I use something other than Apache  :-\

Offline
****
Re: Just Nginx run (wordpress permalink 404)
« Reply #6 on: March 28, 2020, 07:35:31 PM »
Not if you set it on a per user/domain instance.
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Just Nginx run (wordpress permalink 404)
« Reply #7 on: March 28, 2020, 08:52:35 PM »
Hi rcschaff. Thanks, for answer

I have magento websites also. That will not affect the sites with magento? Excuse my ignorance but it is the first time in my professional life that I use something other than Apache  :-\

Great!!

It works fine!!

by the way I made two more changes to the .stpl file:

1- Add ssl directive to each "listen ..."
locate:
Code: [Select]
listen %ip%:%nginx_port% %http2%;replaced by:
Code: [Select]
listen %ip%:%nginx_port% ssl %http2%;
2- Removed each:
Code: [Select]
ssl on;
The above to avoid the nginx warning:
Quote
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl"

Thank very much rcschaff!!

Offline
**
Re: Just Nginx run (wordpress permalink 404)
« Reply #8 on: July 06, 2021, 10:54:22 PM »

nginx does not use .htaccess file.

Follow these Steps
1)  Log into the CLI via SSH
2)  Cd /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/nginx/php-fpm
3) "   cp default.stpl wordpress.stpl  "  and   "   cp default.tpl  wordpress.tpl     "
4)  edit wordpress.stpl and wordpress.tpl (nano/vi)
5) Find location / {
6)  Immediately under that line add  "     try_files $uri $uri/ /index.php?$args;       "  and save it
7)  Log into CWP Admin panel
8)  Webservers -> Webservrs Domain Config
9)  Select user of domain running wordpress
10) Click Create Configuration
11)  Select NGINX-PHPFPM
12)  Nginx default vhost template type:  Set to PHP-FPM
13)  Nginx default vhost template:   Select Wordpress
14) Select your desired PHP-FPM Version
15) Check box to rebuild Webserver Config for domain.
16) Click Save

Wordpress should now work
 Repear 9-16 for other wordpress installations.

I "re upload" this thread just to thank you for this post, excellent post, indication and solution, really great !!

Maybe it goes off the topic of the thread a bit but ... I'm looking for a way to add the line to the .tpl so that it also listens to ipv6, add it manually, I add it and it works, but when there is a reload or similar, not being in template disappears.
Any advice?

Thank you again for this excellent post!