Chạy nextjs trên centos 7, phần 5, cài đặt nginx làm reverse proxy

Đổi port 8080 cho Apache

sudo nano /etc/httpd/conf/httpd.conf
Listen 8080
# ...
<VirtualHost *:8080>
        ServerName 103.81.86.140
        ServerAlias 103.81.86.140
        DocumentRoot /var/www/html
        ErrorLog /var/www/log/error.log
        CustomLog /var/www/log/requests.log combined

        <Directory /var/www/html>
                DirectoryIndex index.php index.html
                AllowOverride all
                Require all granted
                AddHandler php80-fcgi .php
        </Directory>
</VirtualHost>
sudo yum install nginx
sudo nano /etc/nginx/nginx.conf
# Command Root folder và thêm vào như sau
# root         /usr/share/nginx/html;
# location / {
#           proxy_pass http://103.81.86.140:8080/;

#          proxy_http_version 1.1;
#          proxy_set_header Upgrade $http_upgrade;
#            proxy_set_header Connection 'upgrade';
#           proxy_set_header Host $host;
#           proxy_cache_bypass $http_upgrade;

#           proxy_set_header   X-Real-IP             $remote_addr;
#           proxy_set_header   X-Forwarded-For       $proxy_add_x_forwarded_for;
#           proxy_set_header   X-Forwarded-Proto https;

#       }

sudo systemctl start nginx
sudo systemctl enable nginx