Home  >  Article  >  Operation and Maintenance  >  How to use nginx to access local static resources on a linux server

How to use nginx to access local static resources on a linux server

WBOY
WBOYforward
2023-05-19 19:46:041699browse

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

How to use nginx to access local static resources on a linux server

3. Change the port number to 8080

4. Modify the nginx service configuration

vim /etc /nginx/conf.d/nginx.conf

How to use nginx to access local static resources on a linux server

5. Restart nginx service

service nginx restart

6. The page attempts to access local resources

How to use nginx to access local static resources on a linux server

#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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete