Skip to content

Latest commit

 

History

History
93 lines (68 loc) · 2.45 KB

File metadata and controls

93 lines (68 loc) · 2.45 KB

nginx

command

nginx version: nginx/1.10.3 (Ubuntu)
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/share/nginx/)
  -c filename   : set configuration file (default: /etc/nginx/nginx.conf)
  -g directives : set global directives out of configuration file

reload config

$ nginx -s reload

nginx的启动、停止、重载配置、验证配置

IP

location / {
    allow 123.34.12.123;
    allow 11.22.33.1/100;
    deny  all;
}

Nginx配置IP白名单和黑名单

Forbidden access files with specified extension

location ~* \.(ini|docx|txt|doc)$ { 
     deny all;
} 
location ~* \.html$ {
     deny all;
}

Nginx 502 with Codeigniter

Finally found is pho-fpm version error.

location ~ \.php$ {
     # ...
     fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
     # ...
}

Enable conf

$ ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf

Nginx configure https

Nginx 服务器证书安装

413 Request Entity Too Large

/etc/nginx/nginx.conf:

client_max_body_size 20m;

php.ini:

upload_max_filesize = 20M
post_max_size = 20M

Refs