首页 > 代码库 > nginx代理配置

nginx代理配置

server {
    listen       80;
    server_name  api.colortrip.cn;
    client_max_body_size 10m;
    access_log /dev/null;
    #error_log /dev/null;
    error_log  /home/nginxlog/errorlog/error.log;
    location / {
        return 403;
    }
    location ~* /search/ {
        rewrite /search/(.+)$ /$1 break;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001;
    }
}

nginx代理配置