I want to run vuejs app on sub.domain.com
, and I simply configure nginx like bellow:
server {
listen 80;
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/xxx.pem;
ssl_certificate_key /etc/nginx/ssl/xxx.key;
server_name sub.domain.com;
charset utf-8;
root /var/www/xxx/dist;
index index.html index.htm;
location / {
root /var/www/xxx/dist;
try_files $uri /index.html;
}
error_log /var/log/nginx/xxx-error.log;
access_log /var/log/nginx/xxx-access.log;
}
but when I apply this configuration, the vuejs app loads on main domain (domain.com
) and breaks the website. I can not understand what is wrong here!
and also when I remove the lines related to ssl, all is good and it works as I expect on http
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…