Nginx Installation and Deployment
Opening Specified Ports or Disabling Firewall
View the ports that are already open:
firewall-cmd --list-portsOpen a specified port (e.g., port 80 for Nginx):
firewall-cmd --zone=public --add-port=80/tcp --permanentReload the firewall configuration:
firewall-cmd --reloadConfirm the opened ports:
firewall-cmd --list-portsIf needed, you can stop the firewall:
systemctl stop firewalldCheck the firewall status:
systemctl status firewalld
Installation and Deployment
Extract the Nginx installation package:
tar -zxvf nginx-1.16.1.tar.gz -C /usr/local/Install dependencies:
yum install -y pcre pcre-devel yum install -y zlib zlib-develConfigure the installation path:
cd /usr/local/nginx-1.16.1 ./configure --prefix=/usr/local/nginxCompile Nginx:
make && make installConfigure local hostname resolution: Edit
/etc/hostsand add an entry for your local domain:ip cloud.whalealmg.comEdit the Nginx configuration file:
server { listen 80; server_name cloud.whalealmg.com; location / { root /usr/local/nginx/html/dist/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /filingAdmin/ { proxy_pass http://127.0.0.1:8000/; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ~ .*\.(js|css|jpg|jpeg|gif|png|ico|pdf|txt)$ { root /usr/local/nginx/html/dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }Start the Nginx service:
/usr/local/nginx/sbin/nginx
Make sure to adjust paths, domain names, and other configurations as needed for your specific environment.