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;
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 "";
}
}