markdown 简单的Ngnix设置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 简单的Ngnix设置相关的知识,希望对你有一定的参考价值。

The workflow is as follows:

#### 1) Install Ngnix:

```
sudo apt update
sudo apt install nginx
```

#### 2) Ensure NGINX is running and and enabled to start automatically on reboot:

```
sudo systemctl start nginx
sudo systemctl enable nginx
```
#### 3) Create a configuration file for the app in

```
/etc/nginx/conf.d/
server {
listen 80;
listen [::]:80;

server_name example.com;

location / {
proxy_pass http://localhost:3000/;
proxy_buffering off;
}
}
```

#### 4) Test

```
sudo nginx -t
```

#### 5) reload the new configuration

```
sudo nginx -s reload
```

#### 6) Install Certificates

```
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx
```

#### 7) Create Cron Job to renew them every 2 month:

```
0 0 1 1,3,5,7,9,11 1 certbot renew --quiet
5 0 1 1,3,5,7,9,11 1 service nginx reload
```

以上是关于markdown 简单的Ngnix设置的主要内容,如果未能解决你的问题,请参考以下文章

text Lando设置模板文件 - ngnix

ngnix 配置CI框架 与 CI的简单使用

ngnix +tomcat7 简单配置

第一次项目上Linux服务器(七:——Tomcat+ngnix+域名的简单配置)

Docker部署ngnix静态网站

ngnix 部署 vue项目-基础篇