# user root;
worker_processes 1;
events {
worker_connections 1024;
}
http {
# 引入同级目录下的 mime.types
include mime.types;
default_type application/octet-stream;
log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" ';
sendfile on;
# 接受header 的测试
server {
listen 8888;
server_name test.com;
location / {
root /www/51mybb;
index index.html;
}
}
#官网相关
include nginx-refer-conf/xxx.conf;
include nginx-refer-conf/cdxxmx.conf;
# api相关
include nginx-refer-conf/test-api-cdmx.conf;
include nginx-refer-conf/api-cdmx.conf;
#管理相关
include nginx-refer-conf/test-manager-cdmx.conf;
include nginx-refer-conf/manager-cdmx.conf;
}
关键是 log_format
中的$http_x_forwarded_for
同传统的配置$remote_addr
不一样