Control Web Panel
WebPanel => Apache => Nginx => Topic started by: Uncoders 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.
-
Hi, you have to edit nginx Vhost configuration file and add the redirects.
The .htaccess does not work with nginx.
-
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 !
-
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
location ~* "/\.(htaccess|htpasswd)$" {deny all;return 404;}
How did you do it?
Thanks in advance
-
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
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.
-
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 :-\
-
Not if you set it on a per user/domain instance.
-
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:
listen %ip%:%nginx_port% %http2%;
replaced by:
listen %ip%:%nginx_port% ssl %http2%;
2- Removed each:
ssl on;
The above to avoid the nginx warning:
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl"
Thank very much rcschaff!!
-
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!