我正在研究symfony 4应用程序。网站在docker容器中使用let的加密证书。
资产链接存在问题:
<script src="/build/js/app.js"></script>
链接很好,但我有这个问题:
App.js路径:
我的nginx配置:
server {
listen 80;
server_name esgi.be;
location ^~ /.well-known {
allow all;
root /var/www/symfony/;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name esgi.be;
ssl on;
ssl_certificate /etc/letsencrypt/live/esgi.be/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/esgi.be/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/esgi.be/chain.pem;
access_log /dev/stdout;
error_log /dev/stderr info;
root /var/www/symfony/public;
location ^~ /build/ {
alias /var/www/symfony/public/build/;
gzip_static on;
expires max;
add_header Cache-Control public;
}
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
include fastcgi.conf;
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
internal;
}
}
我该怎么做才能解决这个问题?
感谢您的帮助!