我已经在数字海洋服务器ubuntu上部署了nuxt应用,并且我正在使用nginx。在安装SSL证书之前,它工作正常。安装SSL证书后,nuxt应用程序显示在图像,js和CSS文件上找不到404。 这是nginx文件。
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl on;
ssl_certificate /etc/nginx/bundle.cer;
ssl_certificate_key /etc/nginx/ssl/private.key;
server_name foodycode.com;
root /var/www/html; location / {
try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
先谢谢您。