We search the library on nginx yum rpm package: yum List | grep nginx
Find the rpm installation package, we can use yum directly installed: yum install nginx
Nginx modify the configuration file: vi /etc/nginx/nginx.conf
Comment out the following configuration:
# server { # listen 80 default_server; # listen [::]:80 default_server; # server_name _; # root /usr/share/nginx/html; # # # Load configuration files for the default server block. # include /etc/nginx/default.d/*.conf; # # location / { # } # # error_page 404 /404.html; # location = /40x.html { # } # # error_page 500 502 503 504 /50x.html; # location = /50x.html { # } # }
Netcore.conf create a configuration file: vi /etc/nginx/conf.d/netcore.conf
Add Configuration:
server { listen 80; location / { proxy_pass http://localhost:81; } }
Start nginx: systemctl Start nginx
Commonly used commands, restart nginx:
nginx -s reload