1
我需要:nginx的反向代理环
- 点site.com我site.github.io(的作品)
- 点site.com/anything文件系统/现场/ DIST(即作品)
- 点site2.com到site.com文件系统/根/ DIST(不工作,此处显示site.github.io)
site.com.conf
server {
listen 80;
server_name site.com;
location =/{
proxy_pass http://site.github.io;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location/{
root /site/dist;
try_files $uri /index.html;
}
}
site2.com.conf
server {
listen 80;
server_name site2.com;
proxy_set_header Host site.com;
proxy_set_header X-Forwarded-For $remote_addr;
location/{
proxy_pass http://127.0.0.1/$request_uri;
}
}