原创

nginx配置案例

相关nginx配置实例如下:

events {
worker_connections 1024;
}

http {
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 域名;
location / {
root C:/bjs/api/dist;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location /api/ {
#转发到你需要的服务端口上
proxy_pass http://IP/;
}

}
server {
listen 80;
server_name 域名;
location / {
root C:/sb/api/dist;
}
index index.html index.htm;
location /dist {
#转发到你需要的服务端口上
proxy_pass http://IP/;

}
}

}


正文到此结束