使用Nginx反向代理服务非静态laravel文件

时间:2019-05-16 19:56:40

标签: php laravel nginx reverse-proxy non-static

我在docker上有一个laravel应用。该应用可以偶尔存储和管理用户提供的文件。我已经配置了使用laravel为该文件提供服务的途径,但是nginx并未加载它们。

我是否缺少配置?

enter image description here 已经尝试过不同的位置阻止方法,但到目前为止还没有运气。

server {

  listen 80 default_server;
  listen [::]:80 default_server;

  server_name localhost;
  root /var/www/vma/public;
  index index.php index.html index.htm;

  location / {
    try_files $uri $uri/ /index.php$is_args$args;
  }

  # Pass PHP scripts to PHP-FPM
  location ~ \.php$ {
    fastcgi_pass vma_php_server:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
  }

  error_log /var/log/nginx/error.log;
  access_log /var/log/nginx/access.log;

}```

0 个答案:

没有答案
相关问题