How to config nginx on centos basic?
2023-01-30
Install Nginx
1 | yum install epel-release |
Start Nginx
1 | systemctl start nginx |
Add sites-enable
1 | cd /etc/nginx |
Add new site
1 | vim sites-available/YOURSITE.co |
Soft link
1 | ln -s /etc/nginx/sites-available/YOURSITE.co /etc/nginx/sites-enabled/YOURSITE.co |
Open http/https port
1 | firewall-cmd --list-all |
SELinux fix
1 | setsebool -P httpd_can_network_connect 1 |
Restart
1 | nginx -t |
Test nginx vhost locally
1 | vim /etc/hosts |