2.8 完整的样本配置文件
以下示例是一个样本配置文件,它包括了在本章讨论的各个不同方面。请注意,不要复制粘贴该样本配置文件,因为它很可能不是你需要的配置,而只是显示了一个完整配置文件的架构而已。
user www;
worker_processes 12;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
use /dev/poll;
worker_connections 2048;
}
http {
include /opt/local/etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_names_hash_max_size 1024;
server {
listen 80;
return 444;
}
server {
listen 80;
server_name www.example.com;
location / {
try_files $uri $uri/ @mongrel;
}
location @mongrel {
proxy_pass http://127.0.0.1:8080;
}
}
}
时间: 2024-12-22 02:53:51