本文共 1266 字,大约阅读时间需要 4 分钟。
#user nginx;
worker_processes auto;#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;#用服务器IP不能访问server { listen 80; server_name 203.195.211.171; error_page 404 401 400 /400.html; location / { root html; index 400.html; } location = /40x.html{ root html; } }server { listen 80;server_name xxx1.com.cn www.xxx1.com;location / { proxy_pass ;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;root html;index index.html index.htm;}}server {
listen 80;server_name xxx2.com www.xxx2.com;location / { proxy_pass ;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;root html;index index.html index.htm;}}}
转载于:https://blog.51cto.com/13718210/2358226