events {
worker_connections 1024; ## Default: 1024
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
#前端设置了baseUrl的对应配置
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
root E:\project\dist; #单页面项目的打包后的dist目录
# http://localhost/kcart/detail/1
# http://localhost/kcart/js/about.8187b66d.js
location /cart {
try_files $uri /cart/index.html;
}
#nginx反向代理,实现接口转发
location ^~ /api/ {
proxy_pass http://localhost:3000; #注意路径后边不要加/
}
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。