目录转发:
server {
listen 80;
autoindex on;
server_name image.zhengbin.com;
access_log D:/xuexi/20200611/logs/access.log combined;
index index.html index.htm index.jsp index.php;
#error_page 404 /404. html;
if ( $query_string ~* ".*[\;'\<\>].*" ) {
return 404;
}
location ~ /(mmall_fe|mmall_admin_fe)/dist/view/* {
deny all;
}
location / {
root D:\ftpfile\img;
add_header Access-Control-Allow-Origin *;
}
}
端口转发:
server {
listen 80;
autoindex on;
server_name tomcat.zhengbin.com;
access_log D:/xuexi/20200611/logs/access.log combined;
index index.html index.htm index.jsp index.php;
#error_page 404 /404.html;
if ($query_string ~* ".*[\;'\<\>].*") {
return 404;
}
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin *;
}
}