#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 81;
server_name localhost;
#charset koi8-r;
access_log /usr/local/nginx_test/logs/host.access.log ;
##access_log logs/host.access.log 会往旧服务日志路径/usr/local/nginx读写
location / {
root /usr/local/nginx_test/html;
## root html; 不改会往旧服务读写静态文件
index health.html index.html index.htm health.html;
}
涉及路径都要加绝对路径。如果是相对
单机多起nginx服务需要注意
最新推荐文章于 2023-08-04 01:00:20 发布