Py学习  »  docker

无法在docker容器中显示index.php页

sp156 • 4 年前 • 321 次点击  

我有一个docker容器,我设置它来显示一个php页面,但是它显示了一个403禁止页面。我有nginx在我的主机上运行,我也启用了我的网站。网站显示的是html文件,而不是php文件。我还验证了以下服务正在运行。

  1. nginx正在docker容器中运行
  2. php fpm服务正在docker容器中运行。
  3. 用户www data有权执行文件夹中的文件
    server {
      listen 443;
      server_name af.oxygenweb.ca;


      ssl_certificate /etc/letsencrypt/live/af.oxygenweb.ca/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/af.oxygenweb.ca/privkey.pem;

      ssl_stapling on;
      ssl_stapling_verify on;


      location /.well-known {
         alias /var/www/html/.well-known;
      }


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

      location / {
        root /var/www/html;
        index index.php;
        proxy_pass http://172.17.0.2;
        proxy_redirect http:// https://;
        proxy_connect_timeout 300s;
        proxy_read_timeout 300s;
        #try_files $uri /index.html index.php;
      }

      # pass PHP scripts to FastCGI server

      location ~* \.php$ {
          # include snippets/fastcgi-php.conf;
          # pass PHP scripts to FastCGI server
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        include         fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
      }
    }

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/50809
 
321 次点击