安装
更新update
apt-get update
安装 nginx
sudo apt-get install nginx
查看是否安装成功
nginx -v
运行 nginx
启动 nginx
service nginx start
查看 nginx 是否启动
ps -ef | grep nginx
停止 nginx
service nginx stop
重启 nginx
service nginx restart
配置 nginx 服务
修改配置文件 nginx.conf
vim /etc/nginx/nginx.conf
antd Pro 配置信息
server {
listen 80;
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
root ~/weData/build/index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass https://localhost:8080/;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}