0
点赞
收藏
分享

微信扫一扫

Ubuntu安装Nginx

钎探穗 2022-09-01 阅读 135


前言

1、安装

Ubuntu安装Nginx很简单的

sudo apt-get install nginx

2、配置文件位置

需要注意的是Ubuntu安装的Nginx配置文件其实对我们来来说是有两个的

一个是​​nginx.conf​​​ 配置上传的限制大小等
一个是​​​/etc/nginx/sites-available/default​​ 配置正常的属性server

Ubuntu安装Nginx_ubuntu安装

3、启动

sudo nginx -c /etc/nginx/nginx.conf

centos 启动是

./nginx -c conf/nginx.conf

4、上传限制

上传文件的大小超出了 Nginx 允许的最大值,如果没有配置的话,默认是1M;

  client_max_body_size 100m; 上传限制为 100m


http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

client_max_body_size 100m; 上传限制为 100m

Ubuntu安装Nginx_上传_02


举报

相关推荐

0 条评论