1.需要下载gcc编译器不然nginx无法make
Linux安装gcc方法(超简单安装)
Centos版本
终端输入以下命令
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake
yum -y install wget httpd-tools vim
2.正常一个vue项目最简单办法就是直接放html文件,在conf文件里配置root根目录
3.后端端口有时用localhost进不去可以试试用ip
4.配置多个前端项目只要在conf下配置两个server(平级),尽量不用一个端口做两个前端映射,那个alias代理并不是很好用,两个server没有区别
5.每次修改conf需要重启nginx,在sbin或bin目录下直接nginx -s reload即可,在修改dist文件直接丢就行不用重启。
配上conf文件
user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /usr/local/nginx/logs/nginx.pid;
include /user/local/nginx/modules/*.conf;
events {
worker_connections 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;