流明Nginx资产路径问题

问题描述

在Lumen的Docker容器中具有以下Nginx配置

Docker编写Nginx服务

version: '3'
services:
  Nginx:
    container_name: ${PROJECT_SUFFIX}_Nginx
    build: docker/Nginx
    command: Nginx -g "daemon off;"
    links:
      - PHP
    ports:
      - "8099:80"
    #volumes:
    #  - ./app/public:/var/www/html/app/public

Docker安装

FROM Nginx:1.17-alpine
ADD Nginx.conf /etc/Nginx/conf.d/default.conf

Lumen Nginx

server {
  listen 80;
  root /var/www/html/public;
  index index.PHP index.htm index.html;

  location / {
      try_files $uri $uri/ /index.PHP?$query_string;
  }

  location /index.PHP {
      include fastcgi_params;
      fastcgi_connect_timeout 10s;
      fastcgi_read_timeout 10s;
      fastcgi_buffers 256 4k;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_pass PHP:9000;
  }
}

没有加载任何资产文件。我得到404(example http://localhost:8099/front/css/app.css)作为响应,但是路径正确。如何正确调试此问题

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)