{"id":35031,"date":"2024-10-07T16:52:32","date_gmt":"2024-10-07T09:52:32","guid":{"rendered":"http:\/\/jupitek.maudemo.vip\/index.php\/2024\/10\/07\/a-beginners-guide-to-lxd-setting-up-a-reverse-proxy-to-host-mulitple-websites\/"},"modified":"2024-10-07T16:52:32","modified_gmt":"2024-10-07T09:52:32","slug":"a-beginners-guide-to-lxd-setting-up-a-reverse-proxy-to-host-mulitple-websites","status":"publish","type":"post","link":"https:\/\/jupitek.maudemo.vip\/index.php\/2024\/10\/07\/a-beginners-guide-to-lxd-setting-up-a-reverse-proxy-to-host-mulitple-websites\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn LXD cho ng\u01b0\u1eddi m\u1edbi: C\u00e0i \u0111\u1eb7t Reverse Proxy \u0111\u1ec3 host nhi\u1ec1u website"},"content":{"rendered":"<h2 id=\"introduction\">Gi\u1edbi thi\u1ec7u<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#introduction\"><\/a><\/h2>\n<p><a href=\"https:\/\/linuxcontainers.org\/lxd\/\" target=\"_blank\" rel=\"noreferrer noopener\">LXD<\/a>&nbsp;(ph\u00e1t \u00e2m l\u00e0 \u201cLex-Dee\u201d) l\u00e0 tr\u00ecnh qu\u1ea3n l\u00fd v\u00f9ng ch\u1ee9a h\u1ec7 th\u1ed1ng \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean Linux Containers (LXC) \u0111\u01b0\u1ee3c&nbsp;<a href=\"https:\/\/canonical.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Canonical<\/a>&nbsp;h\u1ed7 tr\u1ee3 . M\u1ee5c ti\u00eau c\u1ee7a LXD l\u00e0 cung c\u1ea5p tr\u1ea3i nghi\u1ec7m t\u01b0\u01a1ng t\u1ef1 nh\u01b0 m\u00e1y \u1ea3o nh\u01b0ng th\u00f4ng qua container h\u00f3a thay v\u00ec \u1ea3o h\u00f3a ph\u1ea7n c\u1ee9ng. So v\u1edbi Docker \u0111\u1ec3 ph\u00e2n ph\u1ed1i \u1ee9ng d\u1ee5ng, LXD cung c\u1ea5p ch\u1ee9c n\u0103ng h\u1ec7 \u0111i\u1ec1u h\u00e0nh g\u1ea7n nh\u01b0 \u0111\u1ea7y \u0111\u1ee7 v\u1edbi c\u00e1c t\u00ednh n\u0103ng b\u1ed5 sung nh\u01b0 \u1ea3nh ch\u1ee5p nhanh, di chuy\u1ec3n tr\u1ef1c ti\u1ebfp v\u00e0 qu\u1ea3n l\u00fd l\u01b0u tr\u1eef.<\/p>\n<p>Proxy ng\u01b0\u1ee3c l\u00e0 m\u00e1y ch\u1ee7 n\u1eb1m gi\u1eefa c\u00e1c \u1ee9ng d\u1ee5ng n\u1ed9i b\u1ed9 v\u00e0 m\u00e1y kh\u00e1ch b\u00ean ngo\u00e0i, chuy\u1ec3n ti\u1ebfp c\u00e1c y\u00eau c\u1ea7u c\u1ee7a m\u00e1y kh\u00e1ch \u0111\u1ebfn m\u00e1y ch\u1ee7 th\u00edch h\u1ee3p. M\u1eb7c d\u00f9 nhi\u1ec1u \u1ee9ng d\u1ee5ng ph\u1ed5 bi\u1ebfn, ch\u1eb3ng h\u1ea1n nh\u01b0 Node.js, c\u00f3 th\u1ec3 ho\u1ea1t \u0111\u1ed9ng nh\u01b0 m\u00e1y ch\u1ee7 ri\u00eang, nh\u01b0ng ch\u00fang c\u00f3 th\u1ec3 thi\u1ebfu m\u1ed9t s\u1ed1 t\u00ednh n\u0103ng c\u00e2n b\u1eb1ng t\u1ea3i, b\u1ea3o m\u1eadt v\u00e0 t\u0103ng t\u1ed1c n\u00e2ng cao.<\/p>\n<p>H\u01b0\u1edbng d\u1eabn n\u00e0y gi\u1ea3i th\u00edch c\u00e1ch t\u1ea1o proxy ng\u01b0\u1ee3c trong v\u00f9ng ch\u1ee9a LXD \u0111\u1ec3 l\u01b0u tr\u1eef nhi\u1ec1u trang web, m\u1ed7i trang web trong v\u00f9ng ch\u1ee9a b\u1ed5 sung c\u1ee7a ri\u00eang ch\u00fang. B\u1ea1n s\u1ebd s\u1eed d\u1ee5ng m\u00e1y ch\u1ee7 web NGINX v\u00e0 Apache, \u0111\u1ed3ng th\u1eddi d\u1ef1a v\u00e0o NGINX l\u00e0m proxy ng\u01b0\u1ee3c.<\/p>\n<p>Vui l\u00f2ng tham kh\u1ea3o s\u01a1 \u0111\u1ed3 sau \u0111\u1ec3 hi\u1ec3u v\u1ec1 proxy ng\u01b0\u1ee3c \u0111\u01b0\u1ee3c t\u1ea1o trong h\u01b0\u1edbng d\u1eabn n\u00e0y.<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/reverse-proxy-lxd-diagram_huf0827514de5cd0ee7ee2870fd6981e71_731605_2400x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"Diagram of LXD reverse proxy and web servers\" title=\"Diagram of LXD reverse proxy and web servers\"\/><\/figure>\n<p>Trong h\u01b0\u1edbng d\u1eabn n\u00e0y b\u1ea1n s\u1ebd:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#creating-the-containers\">C\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh container<\/a>&nbsp;cho c\u1ea3 m\u00e1y ch\u1ee7 web NGINX v\u00e0 Apache.<\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#setting-up-the-reverse-proxy\">T\u00ecm hi\u1ec3u c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh proxy ng\u01b0\u1ee3c trong v\u00f9ng ch\u1ee9a<\/a>&nbsp;.<\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#adding-support-for-https-with-lets-encrypt\">Nh\u1eadn h\u1ed7 tr\u1ee3 SSL\/TLS th\u00f4ng qua ch\u1ee9ng ch\u1ec9 Let&#8217;s Encrypt v\u1edbi t\u00ednh n\u0103ng gia h\u1ea1n ch\u1ee9ng ch\u1ec9 t\u1ef1 \u0111\u1ed9ng<\/a>&nbsp;.<\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#troubleshooting\">X\u1eed l\u00fd c\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p<\/a>&nbsp;.<\/li>\n<\/ul>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: \u0110\u1ec3 \u0111\u01a1n gi\u1ea3n, thu\u1eadt ng\u1eef&nbsp;<em>container<\/em>&nbsp;\u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong to\u00e0n b\u1ed9 h\u01b0\u1edbng d\u1eabn n\u00e0y \u0111\u1ec3 m\u00f4 t\u1ea3 c\u00e1c container c\u1ee7a h\u1ec7 th\u1ed1ng LXD.<\/p>\n<h3 id=\"before-you-begin\">Tr\u01b0\u1edbc khi b\u1ea1n b\u1eaft \u0111\u1ea7u<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#before-you-begin\"><\/a><\/h3>\n<p>1.Ho\u00e0n th\u00e0nh&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/\">H\u01b0\u1edbng d\u1eabn d\u00e0nh cho ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u v\u1ec1 LXD: Thi\u1ebft l\u1eadp m\u00e1y ch\u1ee7 web Apache trong v\u00f9ng ch\u1ee9a<\/a>&nbsp;. H\u01b0\u1edbng d\u1eabn h\u01b0\u1edbng d\u1eabn b\u1ea1n t\u1ea1o v\u00f9ng ch\u1ee9a \u0111\u01b0\u1ee3c g\u1ecdi&nbsp;<code>web<\/code>b\u1eb1ng m\u00e1y ch\u1ee7 web Apache cho m\u1ee5c \u0111\u00edch th\u1eed nghi\u1ec7m. X\u00f3a v\u00f9ng ch\u1ee9a n\u00e0y b\u1eb1ng c\u00e1ch ch\u1ea1y c\u00e1c l\u1ec7nh sau.<\/p>\n<pre class=\"wp-block-code\"><code>lxc stop web\nlxc delete web<\/code><\/pre>\n<p>Ghi ch\u00fa<\/p>\n<p>\u0110\u1ed1i v\u1edbi h\u01b0\u1edbng d\u1eabn n\u00e0y, c\u1ea7n c\u00f3 LXD phi\u00ean b\u1ea3n 3.3 tr\u1edf l\u00ean. Ki\u1ec3m tra phi\u00ean b\u1ea3n b\u1eb1ng l\u1ec7nh sau:<\/p>\n<pre class=\"wp-block-code\"><code>lxd --version\n<\/code><\/pre>\n<p>N\u1ebfu phi\u00ean b\u1ea3n kh\u00f4ng ph\u1ea3i l\u00e0 3.3 ho\u1eb7c m\u1edbi h\u01a1n, h\u00e3y c\u1eadp nh\u1eadt l\u00ean phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t b\u1eb1ng c\u00e1ch c\u00e0i \u0111\u1eb7t g\u00f3i snap theo h\u01b0\u1edbng d\u1eabn trong&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd\/\">H\u01b0\u1edbng d\u1eabn d\u00e0nh cho ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u v\u1ec1 LXD: Thi\u1ebft l\u1eadp m\u00e1y ch\u1ee7 web Apache trong v\u00f9ng ch\u1ee9a<\/a>&nbsp;v\u00e0 s\u1eed d\u1ee5ng l\u1ec7nh sau:<\/p>\n<pre class=\"wp-block-code\"><code>sudo lxd.migrate<\/code><\/pre>\n<p>2.H\u01b0\u1edbng d\u1eabn n\u00e0y s\u1eed d\u1ee5ng t\u00ean m\u00e1y ch\u1ee7&nbsp;<code>apache1.example.com<\/code>v\u00e0&nbsp;<code>nginx1.example.com<\/code>cho hai trang web v\u00ed d\u1ee5. Thay th\u1ebf c\u00e1c t\u00ean n\u00e0y b\u1eb1ng t\u00ean m\u00e1y ch\u1ee7 b\u1ea1n s\u1edf h\u1eefu v\u00e0 thi\u1ebft l\u1eadp m\u1ee5c nh\u1eadp DNS c\u1ee7a ch\u00fang \u0111\u1ec3 tr\u1ecf ch\u00fang \u0111\u1ebfn \u0111\u1ecba ch\u1ec9 IP c\u1ee7a m\u00e1y ch\u1ee7 b\u1ea1n \u0111\u00e3 t\u1ea1o. \u0110\u1ec3 \u0111\u01b0\u1ee3c tr\u1ee3 gi\u00fap v\u1ec1 DNS, h\u00e3y xem&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/networking\/dns-manager\/\">H\u01b0\u1edbng d\u1eabn v\u1ec1 Tr\u00ecnh qu\u1ea3n l\u00fd DNS<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i .<\/p>\n<h2 id=\"creating-the-containers\">T\u1ea1o c\u00e1c Container<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#creating-the-containers\"><\/a><\/h2>\n<p>1.T\u1ea1o hai container c\u00f3 t\u00ean l\u00e0&nbsp;<code>apache1<\/code>v\u00e0&nbsp;<code>nginx1<\/code>, m\u1ed9t container v\u1edbi m\u00e1y ch\u1ee7 web Apache v\u00e0 m\u1ed9t container v\u1edbi m\u00e1y ch\u1ee7 web NGINX. \u0110\u1ed1i v\u1edbi b\u1ea5t k\u1ef3 trang web b\u1ed5 sung n\u00e0o, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o container m\u1edbi v\u1edbi ph\u1ea7n m\u1ec1m m\u00e1y ch\u1ee7 web \u0111\u00e3 ch\u1ecdn.<\/p>\n<pre class=\"wp-block-code\"><code>lxc launch ubuntu:18.04 apache1\nlxc launch ubuntu:18.04 nginx1<\/code><\/pre>\n<p>2.T\u1ea1o&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a cho proxy ng\u01b0\u1ee3c.<\/p>\n<pre class=\"wp-block-code\"><code>lxc launch ubuntu:18.04 proxy<\/code><\/pre>\n<p>3.Li\u1ec7t k\u00ea c\u00e1c container b\u1eb1ng l\u1ec7nh list.<\/p>\n<pre class=\"wp-block-code\"><code>lxc list\n<\/code><\/pre>\n<p>4.K\u1ebft qu\u1ea3 tr\u00f4ng t\u01b0\u01a1ng t\u1ef1 nh\u01b0 sau.<\/p>\n<pre class=\"wp-block-code\"><code>+---------+---------+---------------------+-----------------------------------------------+------------+-----------+\n|  NAME   |  STATE  |        IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |\n+---------+---------+---------------------+-----------------------------------------------+------------+-----------+\n| apache1 | RUNNING | 10.10.10.204 (eth0) | fd42:67a4:b462:6ae2:216:3eff:fe01:1a4e (eth0) | PERSISTENT |           |\n+---------+---------+---------------------+-----------------------------------------------+------------+-----------+\n| nginx1  | RUNNING | 10.10.10.251 (eth0) | fd42:67a4:b462:6ae2:216:3eff:febd:67e3 (eth0) | PERSISTENT |           |\n+---------+---------+---------------------+-----------------------------------------------+------------+-----------+\n| proxy   | RUNNING | 10.10.10.28 (eth0)  | fd42:67a4:b462:6ae2:216:3eff:fe00:252e (eth0) | PERSISTENT |           |\n+---------+---------+---------------------+-----------------------------------------------+------------+-----------+<\/code><\/pre>\n<ol>\n<li>C\u00f3 ba container, t\u1ea5t c\u1ea3 \u0111\u1ec1u \u1edf tr\u1ea1ng th\u00e1i&nbsp;<em>CH\u1ea0Y<\/em>&nbsp;\u2013 m\u1ed7i container c\u00f3 \u0111\u1ecba ch\u1ec9 IP ri\u00eang. L\u01b0u \u00fd c\u00e1c \u0111\u1ecba ch\u1ec9 IP (c\u1ea3 IPv4 v\u00e0 IPv6) cho container&nbsp;<code>proxy<\/code>. B\u1ea1n s\u1ebd c\u1ea7n ch\u00fang \u0111\u1ec3 c\u1ea5u h\u00ecnh&nbsp;<code>proxy<\/code>container trong ph\u1ea7n sau.B\u00e2y gi\u1edd c\u00e1c container \u0111\u00e3 \u0111\u01b0\u1ee3c t\u1ea1o, c\u00e1c b\u01b0\u1edbc sau \u0111\u00e2y s\u1ebd tr\u00ecnh b\u00e0y chi ti\u1ebft c\u00e1ch thi\u1ebft l\u1eadp ph\u1ea7n m\u1ec1m m\u00e1y ch\u1ee7 web trong c\u00e1c container&nbsp;<code>apache1<\/code>v\u00e0&nbsp;<code>nginx1<\/code>, v\u00e0&nbsp;<code>proxy<\/code>container \u0111\u1ec3 c\u00f3 th\u1ec3 truy c\u1eadp m\u00e1y ch\u1ee7 web t\u1eeb Internet.<\/li>\n<\/ol>\n<h3 id=\"configuring-the-apache-web-server-container\">C\u1ea5u h\u00ecnh Container M\u00e1y ch\u1ee7 Web Apache<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#configuring-the-apache-web-server-container\"><\/a><\/h3>\n<p>Khi s\u1eed d\u1ee5ng proxy ng\u01b0\u1ee3c tr\u01b0\u1edbc m\u00e1y ch\u1ee7 web, m\u00e1y ch\u1ee7 web kh\u00f4ng bi\u1ebft \u0111\u1ecba ch\u1ec9 IP c\u1ee7a kh\u00e1ch truy c\u1eadp. M\u00e1y ch\u1ee7 web ch\u1ec9 nh\u00ecn th\u1ea5y \u0111\u1ecba ch\u1ec9 IP c\u1ee7a proxy ng\u01b0\u1ee3c. Tuy nhi\u00ean, m\u1ed7i m\u00e1y ch\u1ee7 web \u0111\u1ec1u c\u00f3 c\u00e1ch \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh \u0111\u1ecba ch\u1ec9 IP t\u1eeb xa th\u1ef1c s\u1ef1 c\u1ee7a kh\u00e1ch truy c\u1eadp. \u0110\u1ed1i v\u1edbi Apache, \u0111i\u1ec1u n\u00e0y \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n b\u1eb1ng m\u00f4-\u0111un Remote IP Apache. \u0110\u1ec3 m\u00f4-\u0111un ho\u1ea1t \u0111\u1ed9ng, proxy ng\u01b0\u1ee3c ph\u1ea3i \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u1ec3 truy\u1ec1n th\u00f4ng tin \u0111\u1ecba ch\u1ec9 IP t\u1eeb xa.<\/p>\n<p>1.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>apache1<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec apache1 -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>2.C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i trong&nbsp;<code>apache1<\/code>container.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n<p>3.C\u00e0i \u0111\u1eb7t g\u00f3i&nbsp;<em>apache2<\/em>&nbsp;v\u00e0o v\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt install -y apache2<\/code><\/pre>\n<p>4.T\u1ea1o t\u1eadp tin&nbsp;<code>\/etc\/apache2\/conf-available\/remoteip.conf<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>RemoteIPHeader X-Real-IP\nRemoteIPTrustedProxy 10.10.10.28 fd42:67a4:b462:6ae2:216:3eff:fe00:252e<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng&nbsp;<code>nano<\/code>tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n b\u1eb1ng c\u00e1ch ch\u1ea1y l\u1ec7nh&nbsp;<code>sudo nano \/etc\/apache2\/conf-available\/remoteip.conf<\/code>. L\u01b0u \u00fd, \u0111\u00e2y l\u00e0 c\u00e1c \u0111\u1ecba ch\u1ec9 IP c\u1ee7a&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb tr\u01b0\u1edbc \u0111\u00f3, cho c\u1ea3 IPv4 v\u00e0 IPv6. Thay th\u1ebf ch\u00fang b\u1eb1ng c\u00e1c IP t\u1eeb&nbsp;<code>lxc list<\/code>\u0111\u1ea7u ra c\u1ee7a b\u1ea1n.<\/p>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: Thay v\u00ec ch\u1ec9 \u0111\u1ecbnh \u0111\u1ecba ch\u1ec9 IP, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng hostname&nbsp;<code>proxy.lxd<\/code>. Tuy nhi\u00ean, m\u00f4-\u0111un RemoteIP Apache c\u00f3 \u0111\u1eb7c \u0111i\u1ec3m ri\u00eang khi s\u1eed d\u1ee5ng hostname v\u00e0 ch\u1ec9 s\u1eed d\u1ee5ng m\u1ed9t trong hai \u0111\u1ecba ch\u1ec9 IP (IPv4 ho\u1eb7c IPv6), ngh\u0129a l\u00e0 m\u00e1y ch\u1ee7 web Apache kh\u00f4ng bi\u1ebft \u0111\u1ecba ch\u1ec9 IP ngu\u1ed3n th\u1ef1c s\u1ef1 cho m\u1ed9t s\u1ed1 k\u1ebft n\u1ed1i. B\u1eb1ng c\u00e1ch li\u1ec7t k\u00ea r\u00f5 r\u00e0ng c\u1ea3 \u0111\u1ecba ch\u1ec9 IPv4 v\u00e0 IPv6, b\u1ea1n c\u00f3 th\u1ec3 ch\u1eafc ch\u1eafn r\u1eb1ng RemoteIP ch\u1ea5p nh\u1eadn th\u00e0nh c\u00f4ng th\u00f4ng tin IP ngu\u1ed3n t\u1eeb t\u1ea5t c\u1ea3 c\u00e1c k\u1ebft n\u1ed1i c\u1ee7a proxy ng\u01b0\u1ee3c.<\/p>\n<p>5.K\u00edch ho\u1ea1t c\u1ea5u h\u00ecnh m\u1edbi&nbsp;<code>remoteip.conf<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>sudo a2enconf remoteip\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Enabling conf remoteip.\nTo activate the new configuration, you need to run:\nsystemctl reload apache2<\/code><\/pre>\n<p>6.K\u00edch ho\u1ea1t&nbsp;<code>remoteip<\/code>m\u00f4-\u0111un Apache.<\/p>\n<pre class=\"wp-block-code\"><code>sudo a2enmod remoteip\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Enabling module remoteip.\nTo activate the new configuration, you need to run:\nsystemctl restart apache2<\/code><\/pre>\n<p>7.Ch\u1ec9nh s\u1eeda trang web m\u1eb7c \u0111\u1ecbnh cho Apache \u0111\u1ec3 tham chi\u1ebfu \u0111\u1ebfn vi\u1ec7c n\u00f3 ch\u1ea1y b\u00ean trong v\u00f9ng ch\u1ee9a LXD.<\/p>\n<pre class=\"wp-block-code\"><code>sudo nano \/var\/www\/html\/index.html<\/code><\/pre>\n<p>\u0110\u1ed5i d\u00f2ng \u201cIt works!\u201d (d\u00f2ng s\u1ed1 224) th\u00e0nh \u201cIt works inside a LXD container!\u201d L\u01b0u v\u00e0 tho\u00e1t.<\/p>\n<p>8.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i m\u00e1y ch\u1ee7 web Apache.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2\n<\/code><\/pre>\n<p>9.Tho\u00e1t tr\u1edf l\u1ea1i m\u00e1y ch\u1ee7.<\/p>\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n<p>B\u1ea1n \u0111\u00e3 t\u1ea1o v\u00e0 c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 web Apache, nh\u01b0ng m\u00e1y ch\u1ee7 v\u1eabn ch\u01b0a th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c t\u1eeb Internet. M\u00e1y ch\u1ee7 s\u1ebd c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c sau khi b\u1ea1n c\u1ea5u h\u00ecnh&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a \u1edf ph\u1ea7n sau.<\/p>\n<h3 id=\"creating-the-nginx-web-server-container\">T\u1ea1o Container M\u00e1y ch\u1ee7 Web NGINX<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#creating-the-nginx-web-server-container\"><\/a><\/h3>\n<p>Gi\u1ed1ng nh\u01b0 Apache, NGINX kh\u00f4ng bi\u1ebft \u0111\u1ecba ch\u1ec9 IP c\u1ee7a kh\u00e1ch truy c\u1eadp khi s\u1eed d\u1ee5ng proxy ng\u01b0\u1ee3c tr\u01b0\u1edbc m\u00e1y ch\u1ee7 web. Thay v\u00e0o \u0111\u00f3, n\u00f3 ch\u1ec9 th\u1ea5y \u0111\u1ecba ch\u1ec9 IP c\u1ee7a proxy ng\u01b0\u1ee3c. M\u1ed7i ph\u1ea7n m\u1ec1m m\u00e1y ch\u1ee7 web NGINX c\u00f3 th\u1ec3 x\u00e1c \u0111\u1ecbnh \u0111\u1ecba ch\u1ec9 IP t\u1eeb xa th\u1ef1c s\u1ef1 c\u1ee7a kh\u00e1ch truy c\u1eadp b\u1eb1ng m\u00f4-\u0111un IP th\u1ef1c. \u0110\u1ec3 m\u00f4-\u0111un ho\u1ea1t \u0111\u1ed9ng, proxy ng\u01b0\u1ee3c ph\u1ea3i \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh ph\u00f9 h\u1ee3p \u0111\u1ec3 truy\u1ec1n th\u00f4ng tin li\u00ean quan \u0111\u1ebfn \u0111\u1ecba ch\u1ec9 IP t\u1eeb xa.<\/p>\n<p>1.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>nginx1<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec nginx1 -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>2.C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i trong&nbsp;<code>nginx1<\/code>container.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt update\n<\/code><\/pre>\n<p>3.C\u00e0i \u0111\u1eb7t&nbsp;<em>NGINX<\/em>&nbsp;v\u00e0o container.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt install -y nginx\n<\/code><\/pre>\n<p>4.T\u1ea1o t\u1eadp tin&nbsp;<code>\/etc\/nginx\/conf.d\/real-ip.conf<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>real_ip_header    X-Real-IP;\nset_real_ip_from  proxy.lxd;<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng&nbsp;<code>nano<\/code>tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n b\u1eb1ng c\u00e1ch ch\u1ea1y l\u1ec7nh&nbsp;<code>sudo nano \/etc\/nginx\/conf.d\/real-ip.conf<\/code>.<\/p>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: B\u1ea1n \u0111\u00e3 ch\u1ec9 \u0111\u1ecbnh t\u00ean m\u00e1y ch\u1ee7 c\u1ee7a proxy ng\u01b0\u1ee3c, proxy.lxd. M\u1ed7i v\u00f9ng ch\u1ee9a LXD t\u1ef1 \u0111\u1ed9ng nh\u1eadn \u0111\u01b0\u1ee3c m\u1ed9t t\u00ean m\u00e1y ch\u1ee7, l\u00e0 t\u00ean c\u1ee7a v\u00f9ng ch\u1ee9a c\u1ed9ng v\u1edbi h\u1eadu t\u1ed1 .lxd. B\u1eb1ng c\u00e1ch ch\u1ec9 \u0111\u1ecbnh set_real_ip_fromtr\u01b0\u1eddng c\u00f3 proxy.lxd, b\u1ea1n \u0111ang h\u01b0\u1edbng d\u1eabn m\u00e1y ch\u1ee7 web NGINX ch\u1ea5p nh\u1eadn th\u00f4ng tin \u0111\u1ecba ch\u1ec9 IP th\u1ef1c cho m\u1ed7i k\u1ebft n\u1ed1i, mi\u1ec5n l\u00e0 k\u1ebft n\u1ed1i \u0111\u00f3 b\u1eaft ngu\u1ed3n t\u1eeb proxy.lxd. Th\u00f4ng tin \u0111\u1ecba ch\u1ec9 IP th\u1ef1c \u0111\u01b0\u1ee3c t\u00ecm th\u1ea5y trong ti\u00eau \u0111\u1ec1 HTTP X-Real-IPtrong m\u1ed7i k\u1ebft n\u1ed1i.<\/p>\n<p>5.Ch\u1ec9nh s\u1eeda trang web m\u1eb7c \u0111\u1ecbnh cho NGINX \u0111\u1ec3 t\u1ea1o tham chi\u1ebfu r\u1eb1ng n\u00f3 ch\u1ea1y b\u00ean trong v\u00f9ng ch\u1ee9a LXD.<\/p>\n<pre class=\"wp-block-code\"><code>sudo nano \/var\/www\/html\/index.nginx-debian.html<\/code><\/pre>\n<p>\u0110\u1ed5i d\u00f2ng \u201cWelcome to nginx!\u201d (d\u00f2ng s\u1ed1 14) th\u00e0nh \u201cWelcome to nginx running in a LXD system container!\u201d. L\u01b0u v\u00e0 tho\u00e1t.<\/p>\n<p>6.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i m\u00e1y ch\u1ee7 web NGINX.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n<p>7.Tho\u00e1t tr\u1edf l\u1ea1i m\u00e1y ch\u1ee7.<\/p>\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n<p>B\u1ea1n \u0111\u00e3 t\u1ea1o v\u00e0 c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 web NGINX, nh\u01b0ng m\u00e1y ch\u1ee7 v\u1eabn ch\u01b0a th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c t\u1eeb Internet. B\u1ea1n c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c sau khi c\u1ea5u h\u00ecnh proxycontainer trong ph\u1ea7n ti\u1ebfp theo.<\/p>\n<h2 id=\"setting-up-the-reverse-proxy\">Thi\u1ebft l\u1eadp Proxy ng\u01b0\u1ee3c<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#setting-up-the-reverse-proxy\"><\/a><\/h2>\n<p>Trong ph\u1ea7n n\u00e0y, b\u1ea1n s\u1ebd c\u1ea5u h\u00ecnh container&nbsp;<code>proxy<\/code>. B\u1ea1n s\u1ebd c\u00e0i \u0111\u1eb7t NGINX v\u00e0 thi\u1ebft l\u1eadp n\u00f3 nh\u01b0 m\u1ed9t proxy ng\u01b0\u1ee3c, sau \u0111\u00f3 th\u00eam&nbsp;<em>thi\u1ebft b\u1ecb proxy<\/em>&nbsp;LXD th\u00edch h\u1ee3p \u0111\u1ec3 \u0111\u01b0a c\u1ea3 hai c\u1ed5ng 80 v\u00e0 443 ra internet.<\/p>\n<p>1.Th\u00eam&nbsp;<strong>thi\u1ebft b\u1ecb proxy<\/strong>&nbsp;LXD \u0111\u1ec3 chuy\u1ec3n h\u01b0\u1edbng k\u1ebft n\u1ed1i t\u1eeb internet \u0111\u1ebfn c\u1ed5ng 80 (HTTP) v\u00e0 443 (HTTPS) tr\u00ean m\u00e1y ch\u1ee7 \u0111\u1ebfn c\u00e1c c\u1ed5ng t\u01b0\u01a1ng \u1ee9ng t\u1ea1i&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc config device add proxy myport80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80 proxy_protocol=true\n lxc config device add proxy myport443 proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443 proxy_protocol=true<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Device myport80 added to proxy\nDevice myport443 added to proxy<\/code><\/pre>\n<p>L\u1ec7nh n\u00e0y&nbsp;<code>lxc config device add<\/code>l\u1ea5y c\u00e1c \u0111\u1ed1i s\u1ed1 sau:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>L\u00fd l\u1ebd<\/th>\n<th>Gi\u1ea3i th\u00edch<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>proxy<\/code><\/td>\n<td>T\u00ean c\u1ee7a container.<\/td>\n<\/tr>\n<tr>\n<td><code>myport80<\/code><\/td>\n<td>T\u00ean cho thi\u1ebft b\u1ecb proxy n\u00e0y.<\/td>\n<\/tr>\n<tr>\n<td><code>proxy<\/code><\/td>\n<td>Lo\u1ea1i thi\u1ebft b\u1ecb LXD ( thi\u1ebft b\u1ecb&nbsp;<em>proxy<\/em>&nbsp;LXD ).<\/td>\n<\/tr>\n<tr>\n<td><code>listen=tcp:0.0.0.0:80<\/code><\/td>\n<td>Thi\u1ebft b\u1ecb proxy l\u1eafng nghe m\u00e1y ch\u1ee7 (m\u1eb7c \u0111\u1ecbnh) tr\u00ean c\u1ed5ng 80, giao th\u1ee9c TCP, tr\u00ean t\u1ea5t c\u1ea3 c\u00e1c giao di\u1ec7n.<\/td>\n<\/tr>\n<tr>\n<td><code>connect=tcp:127.0.0.1:80<\/code><\/td>\n<td>Thi\u1ebft b\u1ecb proxy k\u1ebft n\u1ed1i v\u1edbi container tr\u00ean c\u1ed5ng 80, giao th\u1ee9c TCP, tr\u00ean giao di\u1ec7n v\u00f2ng l\u1eb7p. Trong c\u00e1c phi\u00ean b\u1ea3n tr\u01b0\u1edbc c\u1ee7a LXD, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh&nbsp;<code>localhost<\/code>t\u1ea1i \u0111\u00e2y. Tuy nhi\u00ean, trong LXD 3.13 ho\u1eb7c m\u1edbi h\u01a1n, b\u1ea1n ch\u1ec9 c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh \u0111\u1ecba ch\u1ec9 IP.<\/td>\n<\/tr>\n<tr>\n<td><code>proxy_protocol=true<\/code><\/td>\n<td>Y\u00eau c\u1ea7u b\u1eadt giao th\u1ee9c PROXY \u0111\u1ec3 proxy ng\u01b0\u1ee3c nh\u1eadn \u0111\u01b0\u1ee3c \u0111\u1ecba ch\u1ec9 IP g\u1ed1c t\u1eeb thi\u1ebft b\u1ecb proxy.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Ghi ch\u00fa<\/p>\n<p>N\u1ebfu b\u1ea1n mu\u1ed1n x\u00f3a thi\u1ebft b\u1ecb proxy, h\u00e3y s\u1eed d\u1ee5ng&nbsp;<code>lxc config device remove<\/code>. N\u1ebfu b\u1ea1n mu\u1ed1n x\u00f3a thi\u1ebft b\u1ecb tr\u00ean&nbsp;<code>myport80<\/code>, h\u00e3y ch\u1ea1y l\u1ec7nh sau:<\/p>\n<pre class=\"wp-block-code\"><code>lxc config device remove proxy myport80\n<\/code><\/pre>\n<p>Trong \u0111\u00f3 proxy l\u00e0 t\u00ean c\u1ee7a v\u00f9ng ch\u1ee9a v\u00e0 myport80 l\u00e0 t\u00ean c\u1ee7a thi\u1ebft b\u1ecb.<\/p>\n<p>2.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>proxy<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec proxy -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>3.C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n<p>4.C\u00e0i \u0111\u1eb7t NGINX v\u00e0o container.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt install -y nginx<\/code><\/pre>\n<p>5.\u0110\u0103ng xu\u1ea5t kh\u1ecfi container.<\/p>\n<pre class=\"wp-block-code\"><code>logout\n<\/code><\/pre>\n<h3 id=\"direct-traffic-to-the-apache-web-server-from-the-reverse-proxy\">L\u01b0u l\u01b0\u1ee3ng truy c\u1eadp tr\u1ef1c ti\u1ebfp \u0111\u1ebfn m\u00e1y ch\u1ee7 web Apache t\u1eeb Proxy ng\u01b0\u1ee3c<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#direct-traffic-to-the-apache-web-server-from-the-reverse-proxy\"><\/a><\/h3>\n<p>B\u1ed9 ch\u1ee9a proxy ng\u01b0\u1ee3c \u0111ang ch\u1ea1y v\u00e0 g\u00f3i NGINX \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. \u0110\u1ec3 ho\u1ea1t \u0111\u1ed9ng nh\u01b0 m\u1ed9t proxy ng\u01b0\u1ee3c, h\u00e3y th\u00eam c\u1ea5u h\u00ecnh trang web ph\u00f9 h\u1ee3p \u0111\u1ec3 NGINX c\u00f3 th\u1ec3 x\u00e1c \u0111\u1ecbnh (b\u00ean&nbsp;<code>server_name<\/code>d\u01b0\u1edbi) t\u00ean m\u00e1y ch\u1ee7 ph\u00f9 h\u1ee3p, sau \u0111\u00f3 chuy\u1ec3n (&nbsp;<code>proxy_pass<\/code>b\u00ean d\u01b0\u1edbi) k\u1ebft n\u1ed1i \u0111\u1ebfn b\u1ed9 ch\u1ee9a LXD ph\u00f9 h\u1ee3p.<\/p>\n<p>1.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>proxy<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec proxy -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>2.<code>apache1.example.com<\/code>T\u1ea1o&nbsp;t\u1ec7p&nbsp;<code>\/etc\/nginx\/sites-available\/<\/code>\u0111\u1ec3 c\u1ea5u h\u00ecnh trang web \u0111\u1ea7u ti\u00ean c\u1ee7a b\u1ea1n.<\/p>\n<pre class=\"wp-block-code\"><code>server {\n        listen 80 proxy_protocol;\n        listen &#91;::]:80 proxy_protocol;\n\n        server_name apache1.example.com;\n\n        location \/ {\n                include \/etc\/nginx\/proxy_params;\n\n                proxy_pass http:\/\/apache1.lxd;\n        }\n\n        real_ip_header proxy_protocol;\n        set_real_ip_from 127.0.0.1;\n}<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y&nbsp;<code>sudo nano \/etc\/nginx\/sites-available\/apache1.example.com<\/code>\u0111\u1ec3 m\u1edf tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n v\u00e0 th\u00eam c\u1ea5u h\u00ecnh. L\u01b0u \u00fd, trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y b\u1ea1n ch\u1ec9 c\u1ea7n ch\u1ec9nh s\u1eeda&nbsp;<code>server_name<\/code>th\u00e0nh t\u00ean m\u00e1y ch\u1ee7 c\u1ee7a trang web.<\/p>\n<p>3.K\u00edch ho\u1ea1t trang web.<\/p>\n<pre class=\"wp-block-code\"><code>sudo ln -s \/etc\/nginx\/sites-available\/apache1.example.com \/etc\/nginx\/sites-enabled\/\n<\/code><\/pre>\n<p>4.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i proxy ng\u01b0\u1ee3c NGINX. B\u1eb1ng c\u00e1ch kh\u1edfi \u0111\u1ed9ng l\u1ea1i d\u1ecbch v\u1ee5, NGINX s\u1ebd \u0111\u1ecdc v\u00e0 \u00e1p d\u1ee5ng c\u00e1c h\u01b0\u1edbng d\u1eabn trang web m\u1edbi v\u1eeba \u0111\u01b0\u1ee3c th\u00eam v\u00e0o&nbsp;<code>\/etc\/nginx\/sites-enabled<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx\n<\/code><\/pre>\n<p>5.Tho\u00e1t kh\u1ecfi v\u00f9ng ch\u1ee9a proxy v\u00e0 quay l\u1ea1i m\u00e1y ch\u1ee7.<\/p>\n<pre class=\"wp-block-code\"><code>logout<\/code><\/pre>\n<p>6.T\u1eeb m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n, h\u00e3y truy c\u1eadp URL c\u1ee7a trang web b\u1eb1ng tr\u00ecnh duy\u1ec7t web. B\u1ea1n s\u1ebd th\u1ea5y trang Apache m\u1eb7c \u0111\u1ecbnh:<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/apache-server-running-in-lxd-container_hu6e74c8f6c091fbbef4455ca483af132c_59955_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"Web page of Apache server running in a container\" title=\"Web page of Apache server running in a container.\"\/><\/figure>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: N\u1ebfu b\u1ea1n xem t\u1ec7p Apache access.log (t\u1ec7p m\u1eb7c \u0111\u1ecbnh&nbsp;<code>\/var\/log\/apache2\/access.log<\/code>), n\u00f3 v\u1eabn hi\u1ec3n th\u1ecb \u0111\u1ecba ch\u1ec9 IP ri\u00eang c\u1ee7a&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a thay v\u00ec \u0111\u1ecba ch\u1ec9 IP th\u1ef1c. S\u1ef1 c\u1ed1 n\u00e0y ch\u1ec9 x\u1ea3y ra v\u1edbi m\u00e1y ch\u1ee7 web Apache v\u00e0 li\u00ean quan \u0111\u1ebfn c\u00e1ch m\u00e1y ch\u1ee7 in nh\u1eadt k\u00fd. Ph\u1ea7n m\u1ec1m kh\u00e1c tr\u00ean m\u00e1y ch\u1ee7 web c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng IP th\u1ef1c. \u0110\u1ec3 kh\u1eafc ph\u1ee5c s\u1ef1 c\u1ed1 n\u00e0y th\u00f4ng qua nh\u1eadt k\u00fd Apache, h\u00e3y xem ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#troubleshooting\">X\u1eed l\u00fd s\u1ef1 c\u1ed1<\/a>&nbsp;.<\/p>\n<h3 id=\"direct-traffic-to-the-nginx-web-server-from-the-reverse-proxy\">L\u01b0u l\u01b0\u1ee3ng truy c\u1eadp tr\u1ef1c ti\u1ebfp \u0111\u1ebfn m\u00e1y ch\u1ee7 web NGINX t\u1eeb Proxy ng\u01b0\u1ee3c<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#direct-traffic-to-the-nginx-web-server-from-the-reverse-proxy\"><\/a><\/h3>\n<p>B\u1ed9 ch\u1ee9a proxy ng\u01b0\u1ee3c \u0111ang ch\u1ea1y v\u00e0&nbsp;<code>NGINX<\/code>g\u00f3i \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. \u0110\u1ec3 ho\u1ea1t \u0111\u1ed9ng nh\u01b0 m\u1ed9t proxy ng\u01b0\u1ee3c, b\u1ea1n c\u1ea7n th\u00eam c\u1ea5u h\u00ecnh trang web ph\u00f9 h\u1ee3p \u0111\u1ec3&nbsp;<code>NGINX<\/code>c\u00f3 th\u1ec3 x\u00e1c \u0111\u1ecbnh (b\u00ean&nbsp;<code>server_name<\/code>d\u01b0\u1edbi) t\u00ean m\u00e1y ch\u1ee7 ph\u00f9 h\u1ee3p, sau \u0111\u00f3 chuy\u1ec3n (b\u00ean&nbsp;<code>proxy_pass<\/code>d\u01b0\u1edbi) k\u1ebft n\u1ed1i \u0111\u1ebfn b\u1ed9 ch\u1ee9a LXD ph\u00f9 h\u1ee3p v\u1edbi ph\u1ea7n m\u1ec1m m\u00e1y ch\u1ee7 web th\u1ef1c t\u1ebf.<\/p>\n<p>1.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>proxy<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec proxy -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>2.<code>nginx1.example.com<\/code>T\u1ea1o&nbsp;t\u1ec7p&nbsp;<code>\/etc\/nginx\/sites-available\/<\/code>\u0111\u1ec3 c\u1ea5u h\u00ecnh trang web th\u1ee9 hai c\u1ee7a b\u1ea1n.<\/p>\n<pre class=\"wp-block-code\"><code>server {\n        listen 80 proxy_protocol;\n        listen &#91;::]:80 proxy_protocol;\n\n        server_name nginx1.example.com;\n\n        location \/ {\n                include \/etc\/nginx\/proxy_params;\n\n                proxy_pass http:\/\/nginx1.lxd;\n        }\n\n        real_ip_header proxy_protocol;\n        set_real_ip_from 127.0.0.1;\n}<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y&nbsp;<code>sudo nano \/etc\/nginx\/sites-available\/nginx1.example.com<\/code>\u0111\u1ec3 t\u1ea1o c\u1ea5u h\u00ecnh. L\u01b0u \u00fd, b\u1ea1n ch\u1ec9 c\u1ea7n ch\u1ec9nh s\u1eeda c\u00e1c tr\u01b0\u1eddng&nbsp;<code>server_name<\/code>th\u00e0nh t\u00ean m\u00e1y ch\u1ee7 c\u1ee7a trang web.<\/p>\n<p>3.K\u00edch ho\u1ea1t trang web.<\/p>\n<pre class=\"wp-block-code\"><code>sudo ln -s \/etc\/nginx\/sites-available\/nginx1.example.com \/etc\/nginx\/sites-enabled\/\n<\/code><\/pre>\n<p>4.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i d\u1ecbch v\u1ee5 proxy ng\u01b0\u1ee3c NGINX.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n<p>5.Tho\u00e1t kh\u1ecfi v\u00f9ng ch\u1ee9a proxy v\u00e0 quay l\u1ea1i m\u00e1y ch\u1ee7.<\/p>\n<pre class=\"wp-block-code\"><code>logout<\/code><\/pre>\n<p>6.T\u1eeb m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n, h\u00e3y truy c\u1eadp URL c\u1ee7a trang web b\u1eb1ng tr\u00ecnh duy\u1ec7t web. B\u1ea1n s\u1ebd th\u1ea5y trang NGINX m\u1eb7c \u0111\u1ecbnh sau.<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/apache-server-running-in-lxd-container_hu6e74c8f6c091fbbef4455ca483af132c_59955_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"Web page of the nginx server running in a container\"><\/p>\n<h3 id=\"adding-support-for-https-with-lets-encrypt\">Th\u00eam h\u1ed7 tr\u1ee3 cho HTTPS v\u1edbi Let&#8217;s Encrypt<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#adding-support-for-https-with-lets-encrypt\"><\/a><\/h3>\n<p>1.B\u1eaft \u0111\u1ea7u m\u1ed9t v\u1ecf trong&nbsp;<code>proxy<\/code>th\u00f9ng ch\u1ee9a.<\/p>\n<pre class=\"wp-block-code\"><code>lxc exec proxy -- sudo --user ubuntu --login\n<\/code><\/pre>\n<p>2.Th\u00eam kho l\u01b0u tr\u1eef&nbsp;<code>ppa:certbot\/certbot<\/code>b\u1eb1ng c\u00e1ch ch\u1ea1y l\u1ec7nh sau.<\/p>\n<pre class=\"wp-block-code\"><code>sudo add-apt-repository ppa:certbot\/certbot\n<\/code><\/pre>\n<p>3.K\u1ebft qu\u1ea3 tr\u00f4ng t\u01b0\u01a1ng t\u1ef1 nh\u01b0 sau.<\/p>\n<pre class=\"wp-block-code\"><code> This is the PPA for packages prepared by Debian Let's Encrypt Team and backported for Ubuntu(s).\n      More info: https:\/\/launchpad.net\/~certbot\/+archive\/ubuntu\/certbot\n     Press &#91;ENTER] to continue or Ctrl-c to cancel adding it.\n\n     Get:1 http:\/\/security.ubuntu.com\/ubuntu bionic-security InRelease &#91;88.7 kB]\n     ...\n     Fetched 3360 kB in 2s (2018 kB\/s)\n     Reading package lists... Done<\/code><\/pre>\n<p>4.C\u00e0i \u0111\u1eb7t hai g\u00f3i sau \u0111\u1ec3 a) h\u1ed7 tr\u1ee3 vi\u1ec7c t\u1ea1o ch\u1ee9ng ch\u1ec9 Let&#8217;s Encrypt; v\u00e0 b) t\u1ef1 \u0111\u1ed9ng c\u1ea5u h\u00ecnh proxy ng\u01b0\u1ee3c NGINX \u0111\u1ec3 s\u1eed d\u1ee5ng ch\u1ee9ng ch\u1ec9 Let&#8217;s Encrypt. C\u00e1c g\u00f3i \u0111\u01b0\u1ee3c k\u00e9o t\u1eeb kho l\u01b0u tr\u1eef m\u1edbi t\u1ea1o.<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt-get install certbot python-certbot-nginx\n<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: C\u1ea5u h\u00ecnh n\u00e0y s\u1ebd c\u1ea5u h\u00ecnh proxy ng\u01b0\u1ee3c \u0111\u1ec3 c\u0169ng ho\u1ea1t \u0111\u1ed9ng nh\u01b0&nbsp;<em>Proxy ch\u1ea5m d\u1ee9t TLS<\/em>&nbsp;. B\u1ea5t k\u1ef3 c\u1ea5u h\u00ecnh HTTPS n\u00e0o c\u0169ng ch\u1ec9 \u0111\u01b0\u1ee3c t\u00ecm th\u1ea5y trong&nbsp;<code>proxy<\/code>v\u00f9ng ch\u1ee9a. B\u1eb1ng c\u00e1ch th\u1ef1c hi\u1ec7n nh\u01b0 v\u1eady, kh\u00f4ng c\u1ea7n ph\u1ea3i th\u1ef1c hi\u1ec7n b\u1ea5t k\u1ef3 t\u00e1c v\u1ee5 n\u00e0o b\u00ean trong v\u00f9ng ch\u1ee9a m\u00e1y ch\u1ee7 web li\u00ean quan \u0111\u1ebfn ch\u1ee9ng ch\u1ec9 v\u00e0 Let&#8217;s Encrypt.<\/p>\n<p>5.Ch\u1ea1y&nbsp;<code>certbot<\/code>d\u01b0\u1edbi d\u1ea1ng root v\u1edbi&nbsp;<code>--nginx<\/code>tham s\u1ed1 \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u1ea5u h\u00ecnh t\u1ef1 \u0111\u1ed9ng Let&#8217;s Encrypt cho trang web \u0111\u1ea7u ti\u00ean. B\u1ea1n \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u cung c\u1ea5p \u0111\u1ecba ch\u1ec9 email h\u1ee3p l\u1ec7 \u0111\u1ec3 gia h\u1ea1n kh\u1ea9n c\u1ea5p v\u00e0 th\u00f4ng b\u00e1o b\u1ea3o m\u1eadt. Sau \u0111\u00f3, b\u1ea1n \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u ch\u1ea5p nh\u1eadn \u0110i\u1ec1u kho\u1ea3n d\u1ecbch v\u1ee5 v\u00e0 li\u1ec7u b\u1ea1n c\u00f3 mu\u1ed1n \u0111\u01b0\u1ee3c Electronic Frontier Foundation li\u00ean h\u1ec7 trong t\u01b0\u01a1ng lai hay kh\u00f4ng. Ti\u1ebfp theo, cung c\u1ea5p trang web m\u00e0 b\u1ea1n \u0111ang k\u00edch ho\u1ea1t HTTPS. Cu\u1ed1i c\u00f9ng, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ecdn thi\u1ebft l\u1eadp ti\u1ec7n \u00edch t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n h\u01b0\u1edbng k\u1ebft n\u1ed1i HTTP sang k\u1ebft n\u1ed1i HTTPS.<\/p>\n<pre class=\"wp-block-code\"><code>sudo certbot --nginx\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator nginx, Installer nginx\nEnter email address (used for urgent renewal and security notices) (Enter 'c' to\ncancel): myemail@example.com\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nPlease read the Terms of Service at\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.2-November-15-2017.pdf. You must\nagree in order to register with the ACME server at\nhttps:&#47;&#47;acme-v02.api.letsencrypt.org\/directory\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(A)gree\/(C)ancel: A\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nWould you be willing to share your email address with the Electronic Frontier\nFoundation, a founding partner of the Let's Encrypt project and the non-profit\norganization that develops Certbot? We'd like to send you email about our work\nencrypting the web, EFF news, campaigns, and ways to support digital freedom.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: N\n\nWhich names would you like to activate HTTPS for?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: apache1.example.com\n2: nginx1.example.com\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input\nblank to select all options shown (Enter 'c' to cancel): 1\nObtaining a new certificate\nPerforming the following challenges:\nhttp-01 challenge for apache1.example.com\nWaiting for verification...\nCleaning up challenges\nDeploying Certificate to VirtualHost \/etc\/nginx\/sites-enabled\/apache1.example.com\n\nPlease choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: No redirect - Make no further changes to the webserver configuration.\n2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for\nnew sites, or if you're confident your site works on HTTPS. You can undo this\nchange by editing your web server's configuration.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate number &#91;1-2] then &#91;enter] (press 'c' to cancel): 2\nRedirecting all traffic on port 80 to ssl in \/etc\/nginx\/sites-enabled\/apache1.example.com\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCongratulations! You have successfully enabled https:\/\/apache1.example.com\n\nYou should test your configuration at:\nhttps:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=apache1.example.com\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\nIMPORTANT NOTES:\n - Congratulations! Your certificate and chain have been saved at:\n   \/etc\/letsencrypt\/live\/apache1.example.com\/fullchain.pem\n   Your key file has been saved at:\n   \/etc\/letsencrypt\/live\/apache1.example.com\/privkey.pem\n   Your cert will expire on 2019-10-07. To obtain a new or tweaked\n   version of this certificate in the future, simply run certbot again\n   with the \"certonly\" option. To non-interactively renew *all* of\n   your certificates, run \"certbot renew\"\n - Your account credentials have been saved in your Certbot\n   configuration directory at \/etc\/letsencrypt. You should make a\n   secure backup of this folder now. This configuration directory will\n   also contain certificates and private keys obtained by Certbot so\n   making regular backups of this folder is ideal.\n - If you like Certbot, please consider supporting our work by:\n\n   Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n   Donating to EFF:                    https:\/\/eff.org\/donate-le<\/code><\/pre>\n<p>6.Ch\u1ea1y&nbsp;<code>certbot<\/code>v\u1edbi t\u01b0 c\u00e1ch l\u00e0 root v\u1edbi&nbsp;<code>--nginx<\/code>tham s\u1ed1 \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u1ea5u h\u00ecnh t\u1ef1 \u0111\u1ed9ng Let&#8217;s Encrypt cho trang web th\u1ee9 hai. \u0110\u00e2y l\u00e0 l\u1ea7n th\u1ee9 hai ch\u00fang t\u00f4i ch\u1ea1y&nbsp;<code>certbot<\/code>, do \u0111\u00f3 ch\u00fang t\u00f4i \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u tr\u1ef1c ti\u1ebfp ch\u1ecdn trang web \u0111\u1ec3 c\u1ea5u h\u00ecnh.<\/p>\n<pre class=\"wp-block-code\"><code>sudo certbot --nginx\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator nginx, Installer nginx\n\nWhich names would you like to activate HTTPS for?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: apache1.example.com\n2: nginx1.example.com\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input\nblank to select all options shown (Enter 'c' to cancel): 2\nObtaining a new certificate\nPerforming the following challenges:\nhttp-01 challenge for nginx1.example.com\nWaiting for verification...\nCleaning up challenges\nDeploying Certificate to VirtualHost \/etc\/nginx\/sites-enabled\/nginx1.example.com\n\nPlease choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: No redirect - Make no further changes to the webserver configuration.\n2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for\nnew sites, or if you're confident your site works on HTTPS. You can undo this\nchange by editing your web server's configuration.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate number &#91;1-2] then &#91;enter] (press 'c' to cancel): 2\nRedirecting all traffic on port 80 to ssl in \/etc\/nginx\/sites-enabled\/nginx1.example.com\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCongratulations! You have successfully enabled https:\/\/nginx1.example.com\n\nYou should test your configuration at:\nhttps:&#47;&#47;www.ssllabs.com\/ssltest\/analyze.html?d=nginx1.example.com\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\nIMPORTANT NOTES:\n - Congratulations! Your certificate and chain have been saved at:\n   \/etc\/letsencrypt\/live\/nginx1.example.com\/fullchain.pem\n   Your key file has been saved at:\n   \/etc\/letsencrypt\/live\/nginx1.example.com\/privkey.pem\n   Your cert will expire on 2019-10-07. To obtain a new or tweaked\n   version of this certificate in the future, simply run certbot again\n   with the \"certonly\" option. To non-interactively renew *all* of\n   your certificates, run \"certbot renew\"\n - If you like Certbot, please consider supporting our work by:\n\n   Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n   Donating to EFF:                    https:\/\/eff.org\/donate-le<\/code><\/pre>\n<p>7.Sau khi th\u00eam t\u1ea5t c\u1ea3 c\u00e1c trang web, h\u00e3y ch\u1ea1y th\u1eed \u0111\u1ec3 ki\u1ec3m tra vi\u1ec7c gia h\u1ea1n ch\u1ee9ng ch\u1ec9. Ki\u1ec3m tra xem t\u1ea5t c\u1ea3 c\u00e1c trang web c\u00f3 \u0111ang c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng hay kh\u00f4ng \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o ti\u1ec7n \u00edch t\u1ef1 \u0111\u1ed9ng c\u1eadp nh\u1eadt ch\u1ee9ng ch\u1ec9 m\u00e0 kh\u00f4ng c\u1ea7n n\u1ed7 l\u1ef1c th\u00eam.<\/p>\n<pre class=\"wp-block-code\"><code>sudo certbot renew --dry-run\n<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nProcessing \/etc\/letsencrypt\/renewal\/apache1.example.com.conf\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCert not due for renewal, but simulating renewal for dry run\nPlugins selected: Authenticator nginx, Installer nginx\nRenewing an existing certificate\nPerforming the following challenges:\nhttp-01 challenge for apache1.example.com\nWaiting for verification...\nCleaning up challenges\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nnew certificate deployed with reload of nginx server; fullchain is\n\/etc\/letsencrypt\/live\/apache1.example.com\/fullchain.pem\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nProcessing \/etc\/letsencrypt\/renewal\/nginx1.example.com.conf\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCert not due for renewal, but simulating renewal for dry run\nPlugins selected: Authenticator nginx, Installer nginx\nRenewing an existing certificate\nPerforming the following challenges:\nhttp-01 challenge for nginx1.example.com\nWaiting for verification...\nCleaning up challenges\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nnew certificate deployed with reload of nginx server; fullchain is\n\/etc\/letsencrypt\/live\/nginx1.example.com\/fullchain.pem\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n** DRY RUN: simulating 'certbot renew' close to cert expiry\n**          (The test certificates below have not been saved.)\n\nCongratulations, all renewals succeeded. The following certs have been renewed:\n  \/etc\/letsencrypt\/live\/apache1.example.com\/fullchain.pem (success)\n  \/etc\/letsencrypt\/live\/nginx1.example.com\/fullchain.pem (success)\n** DRY RUN: simulating 'certbot renew' close to cert expiry\n**          (The test certificates above have not been saved.)\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\nIMPORTANT NOTES:\n - Your account credentials have been saved in your Certbot\n   configuration directory at \/etc\/letsencrypt. You should make a\n   secure backup of this folder now. This configuration directory will\n   also contain certificates and private keys obtained by Certbot so\n   making regular backups of this folder is ideal.<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: G\u00f3i n\u00e0y&nbsp;<code>certbot<\/code>th\u00eam b\u1ed9&nbsp;<em>\u0111\u1ebfm th\u1eddi gian systemd<\/em>&nbsp;\u0111\u1ec3 k\u00edch ho\u1ea1t vi\u1ec7c gia h\u1ea1n t\u1ef1 \u0111\u1ed9ng c\u00e1c ch\u1ee9ng ch\u1ec9 Let&#8217;s Encrypt. B\u1ea1n c\u00f3 th\u1ec3 xem chi ti\u1ebft v\u1ec1 b\u1ed9 \u0111\u1ebfm th\u1eddi gian n\u00e0y b\u1eb1ng c\u00e1ch ch\u1ea1y&nbsp;<code>systemctl list-timers<\/code>.<\/p>\n<p>8.C\u00f4ng c\u1ee5 certbot ch\u1ec9nh s\u1eeda v\u00e0 thay \u0111\u1ed5i c\u00e1c t\u1ec7p c\u1ea5u h\u00ecnh NGINX c\u1ee7a trang web c\u1ee7a b\u1ea1n. Khi th\u1ef1c hi\u1ec7n nh\u01b0 v\u1eady, certbot kh\u00f4ng tu\u00e2n theo&nbsp;<code>listen<\/code>ch\u1ec9 th\u1ecb ban \u0111\u1ea7u (&nbsp;<code>listen 80 proxy_protocol;<\/code>) v\u00e0 kh\u00f4ng th\u00eam&nbsp;<code>proxy_protocol<\/code>tham s\u1ed1 v\u00e0o c\u00e1c d\u00f2ng m\u1edbi \u0111\u01b0\u1ee3c th\u00eam v\u00e0o&nbsp;<code>listen 443 ssl;<\/code>. B\u1ea1n ph\u1ea3i ch\u1ec9nh s\u1eeda c\u00e1c t\u1ec7p c\u1ea5u h\u00ecnh cho m\u1ed7i trang web v\u00e0 th\u00eam&nbsp;<code>proxy_protocol<\/code>v\u00e0o m\u1ed7i d\u00f2ng \u201clisten 443 ssl;\u201d.<\/p>\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/sites-enabled\/apache1.example.com\nsudo nano \/etc\/nginx\/sites-enabled\/nginx1.example.com<\/code><\/pre>\n<pre class=\"wp-block-code\"><code>listen 443 ssl proxy_protocol; # managed by Certbot\nlisten &#91;::]:443 ssl proxy_protocol; # managed by Certbot<\/code><\/pre>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: M\u1ed7i t\u1ec7p c\u1ea5u h\u00ecnh trang web c\u00f3 hai c\u1eb7p&nbsp;<code>listen<\/code>ch\u1ec9 th\u1ecb: HTTP v\u00e0 HTTPS. C\u1eb7p \u0111\u1ea7u ti\u00ean l\u00e0 c\u1eb7p g\u1ed1c cho HTTP \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam v\u00e0o trong ph\u1ea7n tr\u01b0\u1edbc. C\u1eb7p th\u1ee9 hai \u0111\u01b0\u1ee3c certbot th\u00eam v\u00e0o cho HTTPS. \u0110\u00e2y l\u00e0 nh\u1eefng c\u1eb7p v\u00ec ch\u00fang bao g\u1ed3m c\u1ea3 IPv4 v\u00e0 IPv6. K\u00fd hi\u1ec7u&nbsp;<code>[::]<\/code>\u0111\u1ec1 c\u1eadp \u0111\u1ebfn IPv6. Khi th\u00eam tham s\u1ed1&nbsp;<code>proxy_protocol<\/code>, h\u00e3y th\u00eam n\u00f3 tr\u01b0\u1edbc tr\u00ean&nbsp;<code>;<\/code>m\u1ed7i d\u00f2ng nh\u01b0 \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb \u1edf tr\u00ean.<\/p>\n<p>9.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i NGINX.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl restart nginx\n<\/code><\/pre>\n<h2 id=\"troubleshooting\">X\u1eed l\u00fd s\u1ef1 c\u1ed1<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#troubleshooting\"><\/a><\/h2>\n<h3 id=\"browser-error-ssl_error_rx_record_too_long\">L\u1ed7i tr\u00ecnh duy\u1ec7t \u201cSSL_ERROR_RX_RECORD_TOO_LONG\u201d<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#browser-error-ssl_error_rx_record_too_long\"><\/a><\/h3>\n<p>B\u1ea1n \u0111\u00e3 c\u1ea5u h\u00ecnh Certbot v\u00e0 t\u1ea1o c\u1ea5u h\u00ecnh Let&#8217;s Encrypt ph\u00f9 h\u1ee3p cho t\u1eebng trang web. Nh\u01b0ng khi b\u1ea1n truy c\u1eadp trang web t\u1eeb tr\u00ecnh duy\u1ec7t, b\u1ea1n nh\u1eadn \u0111\u01b0\u1ee3c l\u1ed7i sau.<\/p>\n<pre class=\"wp-block-code\"><code>Secure Connection Failed\n\nAn error occurred during a connection to apache1.example.com. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG\n\n    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.\n    Please contact the website owners to inform them of this problem.<\/code><\/pre>\n<p>L\u1ed7i n\u00e0y x\u1ea3y ra khi proxy ng\u01b0\u1ee3c NGINX trong&nbsp;<code>proxy<\/code>container kh\u00f4ng c\u00f3&nbsp;<code>proxy_protocol<\/code>tham s\u1ed1 trong&nbsp;<code>listen 443<\/code>c\u00e1c ch\u1ec9 th\u1ecb. N\u1ebfu kh\u00f4ng c\u00f3 tham s\u1ed1, proxy ng\u01b0\u1ee3c kh\u00f4ng s\u1eed d\u1ee5ng th\u00f4ng tin&nbsp;<em>giao th\u1ee9c PROXY<\/em>&nbsp;tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n c\u00f4ng vi\u1ec7c HTTPS. N\u00f3 v\u00f4 t\u00ecnh truy\u1ec1n th\u00f4ng tin giao th\u1ee9c PROXY \u0111\u1ebfn m\u00f4-\u0111un HTTPS, do \u0111\u00f3 g\u00e2y ra l\u1ed7i b\u1ea3n&nbsp;<em>ghi qu\u00e1 d\u00e0i<\/em>&nbsp;.<\/p>\n<p>Th\u1ef1c hi\u1ec7n theo h\u01b0\u1edbng d\u1eabn \u1edf ph\u1ea7n tr\u01b0\u1edbc v\u00e0 th\u00eam&nbsp;<code>proxy_protocol<\/code>v\u00e0o t\u1ea5t c\u1ea3&nbsp;<code>listen 443<\/code>c\u00e1c ch\u1ec9 th\u1ecb. Cu\u1ed1i c\u00f9ng, kh\u1edfi \u0111\u1ed9ng l\u1ea1i NGINX.<\/p>\n<h3 id=\"error-unable-to-connect-or-this-site-cant-be-reached\">L\u1ed7i \u201cKh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i\u201d ho\u1eb7c \u201cKh\u00f4ng th\u1ec3 truy c\u1eadp trang web n\u00e0y\u201d<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#error-unable-to-connect-or-this-site-cant-be-reached\"><\/a><\/h3>\n<p>Khi b\u1ea1n c\u1ed1 g\u1eafng k\u1ebft n\u1ed1i \u0111\u1ebfn trang web t\u1eeb m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 v\u00e0 nh\u1eadn \u0111\u01b0\u1ee3c l\u1ed7i&nbsp;<em>Kh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i<\/em>&nbsp;ho\u1eb7c&nbsp;<em>Kh\u00f4ng th\u1ec3 truy c\u1eadp trang web n\u00e0y<\/em>&nbsp;, c\u00f3 th\u1ec3 l\u00e0 thi\u1ebft b\u1ecb proxy ch\u01b0a \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh.<\/p>\n<p>Ch\u1ea1y l\u1ec7nh sau tr\u00ean m\u00e1y ch\u1ee7 \u0111\u1ec3 x\u00e1c minh xem LXD c\u00f3 \u0111ang l\u1eafng nghe v\u00e0 c\u00f3 th\u1ec3 ch\u1ea5p nh\u1eadn k\u1ebft n\u1ed1i t\u1edbi c\u1ed5ng 80 (HTTP) v\u00e0 443 (HTTPS) hay kh\u00f4ng.<\/p>\n<pre class=\"wp-block-code\"><code>sudo ss -ltp '( sport = :http || sport = :https )'<\/code><\/pre>\n<p>Ghi ch\u00fa<\/p>\n<p>L\u1ec7nh n\u00e0y&nbsp;<code>ss<\/code>t\u01b0\u01a1ng t\u1ef1 nh\u01b0&nbsp;<code>netstat<\/code>v\u00e0&nbsp;<code>lsof<\/code>. L\u1ec7nh n\u00e0y hi\u1ec3n th\u1ecb th\u00f4ng tin v\u1ec1 k\u1ebft n\u1ed1i m\u1ea1ng. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, ch\u00fang t\u00f4i s\u1eed d\u1ee5ng l\u1ec7nh n\u00e0y \u0111\u1ec3 x\u00e1c minh xem c\u00f3 d\u1ecbch v\u1ee5 n\u00e0o tr\u00ean c\u1ed5ng 80 v\u00e0 443 kh\u00f4ng v\u00e0 \u0111\u00f3 l\u00e0 d\u1ecbch v\u1ee5 n\u00e0o.<\/p>\n<ul>\n<li><code>-l<\/code>, \u0111\u1ec3 hi\u1ec3n th\u1ecb c\u00e1c \u1ed5 c\u1eafm \u0111ang nghe,<\/li>\n<li><code>-t<\/code>, \u0111\u1ec3 ch\u1ec9 hi\u1ec3n th\u1ecb c\u00e1c socket TCP,<\/li>\n<li><code>-p<\/code>, \u0111\u1ec3 hi\u1ec3n th\u1ecb nh\u1eefng ti\u1ebfn tr\u00ecnh n\u00e0o s\u1eed d\u1ee5ng c\u00e1c \u1ed5 c\u1eafm \u0111\u00f3,<\/li>\n<li><code>( sport = :http || sport = :https )<\/code>, \u0111\u1ec3 ch\u1ec9 hi\u1ec3n th\u1ecb c\u1ed5ng 80 v\u00e0 443 (t\u01b0\u01a1ng \u1ee9ng l\u00e0 HTTP v\u00e0 HTTPS).<\/li>\n<\/ul>\n<p>Trong \u0111\u1ea7u ra sau, ch\u00fang ta c\u00f3 th\u1ec3 x\u00e1c minh r\u1eb1ng c\u1ea3 hai c\u1ed5ng 80 v\u00e0 443 (HTTP v\u00e0 HTTPS, t\u01b0\u01a1ng \u1ee9ng) \u0111\u1ec1u \u1edf tr\u1ea1ng th\u00e1i&nbsp;<em>LISTEN<\/em>&nbsp;. Trong c\u1ed9t cu\u1ed1i c\u00f9ng, ch\u00fang ta x\u00e1c minh r\u1eb1ng&nbsp;<code>lxd<\/code>ch\u00ednh quy tr\u00ecnh l\u1eafng nghe.<\/p>\n<pre class=\"wp-block-code\"><code>State     Recv-Q  Send-Q   Local Address:Port   Peer Address:Port\nLISTEN    0       128                  *:http              *:*       users:((\"lxd\",pid=1301,fd=7),(\"lxd\",pid=1301,fd=5))\nLISTEN    0       128                  *:https             *:*       users:((\"lxd\",pid=1349,fd=7),(\"lxd\",pid=1349,fd=5))<\/code><\/pre>\n<p>N\u1ebfu b\u1ea1n th\u1ea5y m\u1ed9t quy tr\u00ecnh \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea kh\u00e1c v\u1edbi&nbsp;<code>lxd<\/code>, h\u00e3y d\u1eebng d\u1ecbch v\u1ee5 \u0111\u00f3 v\u00e0 kh\u1edfi \u0111\u1ed9ng l\u1ea1i&nbsp;<code>proxy<\/code>container. B\u1eb1ng c\u00e1ch kh\u1edfi \u0111\u1ed9ng l\u1ea1i&nbsp;<code>proxy<\/code>container, LXD s\u1ebd \u00e1p d\u1ee5ng l\u1ea1i c\u00e1c thi\u1ebft b\u1ecb proxy.<\/p>\n<h3 id=\"the-apache-accesslog-shows-the-ip-address-of-the-proxy-container\">Apache access.log Hi\u1ec3n th\u1ecb \u0110\u1ecba ch\u1ec9 IP c\u1ee7a Proxy Container<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#the-apache-accesslog-shows-the-ip-address-of-the-proxy-container\"><\/a><\/h3>\n<p>B\u1ea1n \u0111\u00e3 thi\u1ebft l\u1eadp&nbsp;<code>apache1<\/code>container v\u00e0 x\u00e1c minh r\u1eb1ng n\u00f3 c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c t\u1eeb internet. Nh\u01b0ng nh\u1eadt k\u00fd t\u1ea1i&nbsp;<code>\/var\/log\/apache2\/access.log<\/code>v\u1eabn hi\u1ec3n th\u1ecb \u0111\u1ecba ch\u1ec9 IP ri\u00eang c\u1ee7a&nbsp;<code>proxy<\/code>container, c\u00f3 th\u1ec3 l\u00e0 IPv4 ri\u00eang (&nbsp;<em>10.xxx<\/em>&nbsp;) ho\u1eb7c \u0111\u1ecba ch\u1ec9 IPv6 ri\u00eang. C\u00f3 v\u1ea5n \u0111\u1ec1 g\u00ec kh\u00f4ng?<\/p>\n<p>\u0110\u1ecbnh d\u1ea1ng nh\u1eadt k\u00fd m\u1eb7c \u0111\u1ecbnh \u0111\u1ec3 in nh\u1eadt k\u00fd truy c\u1eadp trong Apache ch\u1ec9 in \u0111\u1ecba ch\u1ec9 IP c\u1ee7a m\u00e1y ch\u1ee7 c\u1ee7a b\u01b0\u1edbc nh\u1ea3y cu\u1ed1i c\u00f9ng (t\u1ee9c l\u00e0 m\u00e1y ch\u1ee7 proxy). \u0110\u00e2y l\u00e0 \u0111\u1ecbnh&nbsp;<code>%h<\/code>d\u1ea1ng ch\u1ec9 \u0111\u1ecbnh nh\u01b0 \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb b\u00ean d\u01b0\u1edbi.<\/p>\n<pre class=\"wp-block-code\"><code>LogFormat \"%v:%p %h %l %u %t \\\"%r\\\" %&gt;s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" vhost_combined\nLogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\nLogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %O\" common<\/code><\/pre>\n<p>Ph\u1ea3i&nbsp;<code>%h<\/code>thay th\u1ebf th\u1ee7 c\u00f4ng b\u1eb1ng&nbsp;<code>%a<\/code>tr\u00ecnh ch\u1ec9 \u0111\u1ecbnh \u0111\u1ecbnh d\u1ea1ng, tr\u00ecnh n\u00e0y s\u1ebd in ra gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c tr\u1ea3 v\u1ec1 b\u1edfi m\u00f4-\u0111un RemoteIP Apache th\u1ef1c.<\/p>\n<pre class=\"wp-block-code\"><code>LogFormat \"%v:%p %a %l %u %t \\\"%r\\\" %&gt;s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" vhost_combined\nLogFormat \"%a %l %u %t \\\"%r\\\" %&gt;s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\nLogFormat \"%a %l %u %t \\\"%r\\\" %&gt;s %O\" common<\/code><\/pre>\n<p>1.Ch\u1ea1y l\u1ec7nh sau trong&nbsp;<code>apache1<\/code>v\u00f9ng ch\u1ee9a \u0111\u1ec3 ch\u1ec9nh s\u1eeda t\u1ec7p c\u1ea5u h\u00ecnh&nbsp;<code>httpd.conf<\/code>v\u00e0 th\u1ef1c hi\u1ec7n thay \u0111\u1ed5i t\u1eeb&nbsp;<code>%h<\/code>th\u00e0nh&nbsp;<code>%a<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/apache2.conf<\/code><\/pre>\n<p>2.T\u1ea3i l\u1ea1i d\u1ecbch v\u1ee5 m\u00e1y ch\u1ee7 web Apache.<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2\n<\/code><\/pre>\n<h2 id=\"next-steps\">C\u00e1c b\u01b0\u1edbc ti\u1ebfp theo<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/#next-steps\"><\/a><\/h2>\n<p>B\u1ea1n \u0111\u00e3 thi\u1ebft l\u1eadp proxy ng\u01b0\u1ee3c \u0111\u1ec3 l\u01b0u tr\u1eef nhi\u1ec1u trang web tr\u00ean c\u00f9ng m\u1ed9t m\u00e1y ch\u1ee7 v\u00e0 c\u00e0i \u0111\u1eb7t t\u1eebng trang web trong m\u1ed9t v\u00f9ng ch\u1ee9a ri\u00eang bi\u1ec7t. B\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t c\u00e1c trang web t\u0129nh ho\u1eb7c \u0111\u1ed9ng trong c\u00e1c v\u00f9ng ch\u1ee9a. \u0110\u1ed1i v\u1edbi c\u00e1c trang web \u0111\u1ed9ng, b\u1ea1n c\u00f3 th\u1ec3 c\u1ea7n c\u1ea5u h\u00ecnh b\u1ed5 sung; h\u00e3y ki\u1ec3m tra t\u00e0i li\u1ec7u t\u01b0\u01a1ng \u1ee9ng \u0111\u1ec3 thi\u1ebft l\u1eadp b\u1eb1ng proxy ng\u01b0\u1ee3c. Ngo\u00e0i ra, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng NGINX l\u00e0m proxy ng\u01b0\u1ee3c cho c\u00e1c d\u1ecbch v\u1ee5 kh\u00f4ng ph\u1ea3i HTTP(S).<\/p>\n<h2 id=\"more-information\">Th\u00f4ng tin th\u00eam<\/h2>\n<p>B\u1ea1n c\u00f3 th\u1ec3 mu\u1ed1n tham kh\u1ea3o c\u00e1c ngu\u1ed3n sau \u0111\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin v\u1ec1 ch\u1ee7 \u0111\u1ec1 n\u00e0y. M\u1eb7c d\u00f9 ch\u00fang t\u00f4i cung c\u1ea5p v\u1edbi hy v\u1ecdng r\u1eb1ng ch\u00fang s\u1ebd h\u1eefu \u00edch, nh\u01b0ng xin l\u01b0u \u00fd r\u1eb1ng ch\u00fang t\u00f4i kh\u00f4ng th\u1ec3 \u0111\u1ea3m b\u1ea3o t\u00ednh ch\u00ednh x\u00e1c ho\u1eb7c t\u00ednh k\u1ecbp th\u1eddi c\u1ee7a c\u00e1c t\u00e0i li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef b\u00ean ngo\u00e0i.<\/p>\n<ul>\n<li><a href=\"https:\/\/linuxcontainers.org\/lxd\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gi\u1edbi thi\u1ec7u LXD<\/a><\/li>\n<li><a href=\"https:\/\/discuss.linuxcontainers.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">C\u1ed9ng \u0111\u1ed3ng h\u1ed7 tr\u1ee3 LXD<\/a><\/li>\n<li><a href=\"https:\/\/linuxcontainers.org\/lxd\/try-it\/\" target=\"_blank\" rel=\"noreferrer noopener\">H\u00e3y th\u1eed LXD tr\u1ef1c tuy\u1ebfn<\/a><\/li>\n<li><a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/web-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">M\u00e1y ch\u1ee7 web NGINX<\/a><\/li>\n<li><a href=\"https:\/\/httpd.apache.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">M\u00e1y ch\u1ee7 web Apache<\/a><\/li>\n<li><a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/web-server\/reverse-proxy\/\" target=\"_blank\" rel=\"noreferrer noopener\">C\u00e0i \u0111\u1eb7t Proxy ng\u01b0\u1ee3c NGINX<\/a><\/li>\n<li><a href=\"https:\/\/www.haproxy.com\/blog\/haproxy\/proxy-protocol\/\" target=\"_blank\" rel=\"noreferrer noopener\">Giao th\u1ee9c Proxy<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/TLS_termination_proxy\" target=\"_blank\" rel=\"noreferrer noopener\">Proxy ch\u1ea5m d\u1ee9t TLS<\/a><\/li>\n<\/ul>\n<p>Ngu\u1ed3n: https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-lxd-reverse-proxy\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gi\u1edbi thi\u1ec7u LXD&nbsp;(ph\u00e1t \u00e2m l\u00e0 \u201cLex-Dee\u201d) l\u00e0 tr\u00ecnh qu\u1ea3n l\u00fd v\u00f9ng ch\u1ee9a h\u1ec7 th\u1ed1ng \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean Linux Containers (LXC) \u0111\u01b0\u1ee3c&nbsp;Canonical&nbsp;h\u1ed7 tr\u1ee3 . M\u1ee5c ti\u00eau c\u1ee7a LXD l\u00e0 cung c\u1ea5p tr\u1ea3i nghi\u1ec7m t\u01b0\u01a1ng t\u1ef1 nh\u01b0 m\u00e1y \u1ea3o nh\u01b0ng th\u00f4ng qua container h\u00f3a thay v\u00ec \u1ea3o h\u00f3a ph\u1ea7n c\u1ee9ng. So v\u1edbi Docker \u0111\u1ec3 ph\u00e2n ph\u1ed1i<\/p>\n","protected":false},"author":1,"featured_media":36260,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108],"tags":[],"class_list":["post-35031","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers"],"_links":{"self":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/comments?post=35031"}],"version-history":[{"count":0,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35031\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media\/36260"}],"wp:attachment":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media?parent=35031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/categories?post=35031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/tags?post=35031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}