在我的應用我有3個站點 - 用戶前端,管理控制檯,飛濺頁。我想在本地主機運行用戶前端:8080,在本地主機管理控制檯:8080 /管理和飛濺在本地主機:8080 /飛濺Nginx的:無法在單一網址運行多個網站
要運行這些我用下面的配置:
server {
listen 8080;
server_name localhost;
root /home/ajit/git/univisior;
location/{
alias /home/ajit/git/univisior/FrontEnd/dist/;
index index.html;
try_files $uri $uri/ /index.html;
}
location /admin{
alias /home/ajit/git/univisior/admin/dist/;
index index.html;
try_files $uri $uri/ index.html;
}
location /splash {
alias /home/ajit/git/univisior/Splash/dist/;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://localhost:3000/api;
}
}
具有這種配置的問題是這樣的
- 當我打開管理界面(本地主機:8080 /管理員)我得到錯誤
VM189:1 Uncaught SyntaxError: Unexpected token <
,但是當我運行管理站點的單站點配置它工作正常,nginx的配置粘貼如下:
server {
listen 9010;
server_name localhost;
root /home/ajit/git/univisior/admin/dist;
index index.html index.htm;
location/{
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://localhost:3000/api;
}
location /static {
alias /opt/univisor;
}
}
- 飛濺頁我無法得到images.splash也工作正常,如果我與單一站點配置就像管理員運行此。
用戶前端工作正常,但我面臨的問題與管理和splash.can任何人都可以幫助我解決這個問題。
感謝
刪除/從別名後出現「403 Forbidden」錯誤 –
請發佈或粘貼您的日誌文件。 – 2ps
我發佈了錯誤日誌 –