{"id":25938,"date":"2021-12-25T07:07:58","date_gmt":"2021-12-25T00:07:58","guid":{"rendered":"https:\/\/doc.bnix.vn\/?p=25938"},"modified":"2022-08-14T06:49:23","modified_gmt":"2022-08-13T23:49:23","slug":"cau-hinh-nginx-tren-directadmin-fix-loi-404-wordpress","status":"publish","type":"post","link":"https:\/\/doc.bnix.vn\/cau-hinh-nginx-tren-directadmin-fix-loi-404-wordpress\/","title":{"rendered":"C\u1ea5u h\u00ecnh nginx tr\u00ean Directadmin, fix l\u1ed7i 404 wordpress"},"content":{"rendered":"\n\n
\n \n
\n \n
\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n <\/div>\n \n
\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n
\n \n\n
<\/div>\n <\/div>\n <\/div>\n<\/div>\n \n\n
\n 4.2\/5 - (5 b\u00ecnh ch\u1ecdn) <\/div>\n <\/div>\n\n

Nginx l\u00e0 m\u1ed9t webserver kh\u00f4ng c\u00f2n xa l\u1ea1 v\u1edbi d\u00e2n x\u00e0i web wordpress. V\u1edbi nh\u1eefng \u01b0u \u0111i\u1ec3m tuy\u1ec7t v\u1eddi c\u1ee7a n\u00f3 v\u1ec1 t\u1ed1c \u0111\u1ed9, \u0111\u1ed9 ch\u1ecbu t\u1ea3i,… Directadmin \u0111\u00e3 t\u00edch h\u1ee3p nginx v\u00e0o h\u1ec7 th\u1ed1ng c\u1ee7a m\u00ecnh. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Tuy nhi\u00ean, khi s\u1eed d\u1ee5ng website wordpress n\u00f3 l\u1ea1i x\u1ea3y ra l\u1ed7i 404. R\u1ea5t kh\u00f3 ch\u1ecbu, v\u00ec Directadmin n\u00f3 t\u00edch h\u1ee3p nginx nh\u01b0ng l\u1ea1i kh\u00f4ng c\u1ea5u h\u00ecnh h\u1ed7 tr\u1ee3 cho wordpress (c\u00e1i n\u00e0y hi\u1ec7n ch\u1ec9 c\u00f3 tr\u00ean b\u1ea3n pro pack). <\/p>\n\n\n\n

H\u00f4m nay m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1ch c\u1ea5u h\u00ecnh nginx tr\u00ean directadmin \u0111\u1ec3 fix l\u1ed7i 404 khi d\u00f9ng wordpress.<\/p>\n\n\n\n

\u0110\u1ea7u ti\u00ean, c\u00e1c b\u1ea1n k\u1ebft n\u1ed1i v\u00e0o SSH c\u1ee7a VPS\/Server nh\u00e9. Sau \u0111\u00f3 ch\u1ea1y c\u00e1c l\u1ec7nh sau:<\/p>\n\n\n\n

cd \/usr\/local\/directadmin\/data\/templates\/custom\ncp ..\/nginx_php.conf .\nnano \/usr\/local\/directadmin\/data\/templates\/custom\/nginx_php.conf<\/pre>\n\n\n\n

Sau \u0111\u00f3 b\u1ea1n th\u00eam \u0111o\u1ea1n code sau v\u00e0o cu\u1ed1i c\u00f9ng c\u1ee7a file. Th\u00eam xong th\u00ec b\u1ea5m Ctrl + O \u0111\u1ec3 save l\u1ea1i v\u00e0 Ctrl + X \u0111\u1ec3 tho\u00e1t ra<\/p>\n\n\n\n

location \/ {\n    try_files $uri $uri\/ \/index.php?$args ;\n}<\/pre>\n\n\n\n

Cu\u1ed1i c\u00f9ng l\u00e0 ch\u1ea1y c\u00e1c l\u1ec7nh sau \u0111\u1ec3 t\u1ea1o l\u1ea1i file c\u1ea5u h\u00ecnh nginx cho t\u1ea5t c\u1ea3 t\u00ean mi\u1ec1n \u0111ang s\u1eed d\u1ee5ng<\/p>\n\n\n\n

chown diradmin:diradmin nginx_php.conf\ncd \/usr\/local\/directadmin\/custombuild\n.\/build rewrite_confs<\/pre>\n\n\n\n

N\u1ebfu b\u1ea1n ch\u1ea1y l\u1ec7nh nano \/usr\/local\/directadmin\/data\/templates\/custom\/nginx_php.conf<\/strong> m\u00e0 b\u00e1o l\u1ed7i l\u00e0 do b\u1ea1n ch\u01b0a c\u00e0i tr\u00ecnh s\u1eeda v\u0103n b\u1ea3n nano<\/strong>. H\u00e3y ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 c\u00e0i \u0111\u1eb7t nano. <\/p>\n\n\n\n

# Centos\/Almalinux\/Rocky Linux\nyum -y install nano<\/pre>\n\n\n\n

C\u00e0i xong nano th\u00ec b\u1ea1n ti\u1ebfn h\u00e0nh thao t\u00e1c l\u1ea1i nh\u00e9. Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"

Nginx l\u00e0 m\u1ed9t webserver kh\u00f4ng c\u00f2n xa l\u1ea1 v\u1edbi d\u00e2n x\u00e0i web wordpress. V\u1edbi nh\u1eefng…<\/p>\n","protected":false},"author":3,"featured_media":25939,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[195,49],"tags":[194,59,193],"class_list":["post-25938","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cai-dat-vps-directadmin","category-linux","tag-404-wordpress","tag-directadmin","tag-nginx"],"_links":{"self":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts\/25938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/comments?post=25938"}],"version-history":[{"count":0,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/posts\/25938\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/media\/25939"}],"wp:attachment":[{"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/media?parent=25938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/categories?post=25938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.bnix.vn\/wp-json\/wp\/v2\/tags?post=25938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}