1. Check whether port 80 is occupied. Generally, port 80 is mostly occupied by the apache service.
netstat -anp|grep 80
2. Modify the port number of the apache service
vim /etc/apache2/ports.conf
3. Change the port number to 8080
4. Modify the nginx service configuration
vim /etc /nginx/conf.d/nginx.conf
5. Restart nginx service
service nginx restart
6. The page attempts to access local resources
#7. Access successful!
The above is the detailed content of How to use nginx to access local static resources on a linux server. For more information, please follow other related articles on the PHP Chinese website!