同一台服务器上挂两个项目,这是我当前的nginx配置:
server {
listen 81;
server_name localhost;
location / {
root vueAdmin;
index index.html index.htm;
}
}
server {
listen 80;
server_name localhost;
# charset koi8-r;
# access_log logs/host.access.log main;
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
root /usr/share/nginx/html;
location / {
root html;
index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
location ^~ /jeecg-boot {
proxy_pass http://127.0.0.1:8089/jeecg-boot/;
proxy_set_header Host 127.0.0.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
下面的这个server是第一个项目的,没问题,现在我想再布一个项目,配置在第一个server,用的阿里云的服务器。
想请问:1. 后端说阿里云的有内网外网,代码里配置的域名应该写内网IP还是外网IP
- 这样配置的nginx,我输入IP+监听端口打不开,我的代码放在了html同级目录的vueAdmin文件夹下