nginx部署多个vue项目求大佬指点!

nginx配置如下:nginx.conf
userwww-data;
worker_processesauto;
pid/run/nginx.pid;
events{
worker_connections768;
#multi_accepton;
}
http{
sendfileon;
keepalive_timeout65;
types_hash_max_size2048;
include/etc/nginx/mime.types;
default_typeapplication/octet-stream;
ssl_protocolsTLSv1TLSv1.1TLSv1.2;#DroppingSSLv3,ref:POODLE
ssl_prefer_server_cipherson;
access_log/var/log/nginx/access.log;
error_log/var/log/nginx/error.log;
gzipon;
gzip_disable"msie6";
access_log/var/log/nginx/access.log;
error_log/var/log/nginx/error.log;
gzipon;
gzip_disable"msie6";
include/etc/nginx/conf.d/*.conf;
include/etc/nginx/sites-enabled/*;
}
sites-enabled>default
server{
listen80default_server;
listen[::]:80default_server;
#Addindex.phptothelistifyouareusingPHP
indexindex.htmlindex.htmindex.nginx-debian.html;
server_name_;
location/{
#Firstattempttoserverequestasfile,then
#asdirectory,thenfallbacktodisplayinga404.
proxy_passhttp://127.0.0.1:3000;
}
location/admin/{
root/root/cms-admin/dist;
try_files$uri$uri//index.html;
indexindex.htmlindex.htm;
}
location~.*\.(js|css|png|jpg|gif|swf|ico|pdf|mov|mp3|wav|json|woff2)${
proxy_passhttp://127.0.0.1:3000;
}
location/api/{
proxy_passhttp://127.0.0.1:3002/api/;
}
}
3000端口跑了一个ssr项目,可以正常访问访问xxx/admin返回500,请问是哪里出了问题可以确定/root/cms-admin/dist下存在index.html文件
POPMUISE
浏览 859回答 2
2回答

紫衣仙女

这样看不出来问题,你把配置全发出来看看。如果不方便的话,可以在location中通过return600;方式,一步步调试,确认哪里出问题了。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript