Asking for advice on the problem of nginx address forwarding
ringa_lee
ringa_lee 2017-05-16 17:21:28
0
1
372

When a request is made to access a file under /test/, it is forwarded to ip: port 80. How to configure this under nginx

The following is the configuration file content
upstream api_servers {
server 127.0.0.1:9500;

http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive

keepalive 16;
}
server {
listen 80;
server_name www.yuming.com;
root /home/yuming/web;

listen 443 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

location ~*\.(jpg|gif|png|swf|flv|wma|wmv|asf|mp3|mmf|zip|rar|txt|amr|js|css|html?)$ {
root /home/yuming/web;
}

location / {
proxy_pass http://api_servers;
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_Forwardeded_For;
Client_max_body_size 10m;
Client_bule_size 128k;
Proxy_timeout 90;
PROXY_SEN d_timeout 90;
Proxy_read_timeout 90;
Proxy_buffer_size 4K 4K 4K proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_http_version 1.1;
proxy_set_header Connection "";
}

}

ringa_lee
ringa_lee

ringa_lee

reply all(1)
Ty80

location ^~/directory/{

    proxy_pass   http://ip:80;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!