nginx配置
server {
listen 9920;
server_name localhost;
client_max_body_size 10m;
location ^~ /saveTemp/ { client_max_body_size 10m; root D:/; }
# html
location ~ \.(html|gif|jpg|jpeg|png|bmp|swf|eot|svg|ttf|woff|js|css|json|txt|xml|pdf)$ {
root ***项目路径***;
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_cache_key $host$uri$is_args$args;
}
location ^~ /api/ {
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;
proxy_cache_key $host$uri$is_args$args;
}
}
访问
ip地址+端口+页面路径