“Nginx”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) |
Jihongchang(讨论 | 贡献) (→配置文件) |
||
第40行: | 第40行: | ||
/etc/nginx/nginx.conf | /etc/nginx/nginx.conf | ||
+ | |||
+ | === 典型配置 === | ||
+ | <syntaxhighlight lang="console"> | ||
+ | worker_processes 1; | ||
+ | |||
+ | events { | ||
+ | worker_connections 1024; | ||
+ | } | ||
+ | |||
+ | http { | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name example.com; | ||
+ | location / { | ||
+ | root /var/www/example.com; | ||
+ | index index.html index.htm; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </syntaxhighlight> | ||
=== 进程 ID 文件 === | === 进程 ID 文件 === |
2023年2月10日 (五) 06:29的版本
目录结构
conf.d
fastcgi.conf
fastcgi_params
koi-utf
koi-win
logs
mime.types
modules-available
modules-enabled
nginx.conf
proxy_params
scgi_params
sites-available
sites-enabled
snippets
uwsgi_params
win-utf
配置文件
/etc/nginx/nginx.conf
典型配置
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name example.com;
location / {
root /var/www/example.com;
index index.html index.htm;
}
}
}
进程 ID 文件
/run/nginx.pid
校验配置文件
pi@raspberrypi:~ $ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
pi@raspberrypi:~ $
重启
pi@raspberrypi:~ $ sudo nginx -s reload
pi@raspberrypi:~ $