Linux server deployments .Net Core notes: Five, install Nginx

Original: Linux server deployments .Net Core notes: Five, install Nginx

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:

Copy the code
#    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 {
#        }
#    }
Copy the code

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

 

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12070771.html