why in this https get:
为什么在这个https获取:
10.0.2.2 - - [09/Sep/2023:18:04:23 +0000] "GET / HTTP/1.1" 403 199 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
in this nginx server:
在此nginx服务器中:
server {
server_name dcruz-na.42.fr www.dcruz-na.42.fr;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_certificate /etc/nginx/ssl/dcruz-na.crt;
ssl_certificate_key /etc/nginx/ssl/dcruz-na.key;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
listen 443 ssl;
listen [::]:443 ssl;
root /var/www/html;
index index.php;
location / {
autoindex off;
try_files $uri $uri/ /index.php?$args;
}
location ~ [^/]\\.php(/|$) {
fastcgi_index index.php;
try_files $uri =404;
fastcgi_pass wordpress:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
the server returns 403 forbidden por este error en los log: 2023/09/09 18:04:23 [error] 7#7: *5 directory index of "/var/www/html/" is forbidden, client: 10.0.2.2, server: dcruz-na.42.fr, request: "GET / HTTP/1.1", host: "localhost"
服务器返回403禁止访问错误日志:2023/09/09 18:04:23[错误]7#7:*5目录索引“/var/www/html/”被禁止,客户端:10.0.2.2,服务器:druz-na.42.fr,请求:“GET/HTTP/1.1”,主机:“本地主机”
I want php-fpm which is in the container wordpress:9000 to serve me the wordpress php files, the index.php when get /
我希望容器WordPress:9000中的php-fpm为我提供WordPress php文件,当GET/时是index.php
更多回答
I already changed it to english
我已经把它改成英语了
优秀答案推荐
The error message "directory index of /var/www/html/ is forbidden" means that the web server (Nginx) is configured to not allow browsing the contents of the directory /var/www/html/. This can be caused by a number of things, such as:
错误消息“DIRECTORY INDEX of/var/www/html/is forhibited”表示Web服务器(Nginx)被配置为不允许浏览/var/www/html/目录的内容。这可能是由多种原因引起的,例如:
- There is no index.html file in the directory.
- The directory is not owned by the web server user.
- The directory permissions are not set to allow the web server user to read and execute files.
To fix this error, you need to make sure that the following conditions are met:
要修复此错误,您需要确保满足以下条件:
- There is an index.html file in the directory /var/www/html/.
- The directory is owned by the web server user.
- The directory permissions are set to allow the web server user to read and execute files.
You can check the ownership and permissions of the directory using the following commands:
您可以使用以下命令检查目录的所有权和权限:
ls -l /var/www/html/
If the directory is not owned by the web server user, you can change the ownership using the following command:
如果目录不属于Web服务器用户,您可以使用以下命令更改所有权:
chown -R www-data:www-data /var/www/html/
If the directory permissions are not set to allow the web server user to read and execute files, you can change the permissions using the following command:
如果未将目录权限设置为允许Web服务器用户读取和执行文件,则可以使用以下命令更改权限:
chmod -R 755 /var/www/html/
Once you have made sure that the above conditions are met, the error message should go away.
确保满足上述条件后,错误消息应该会消失。
Here are some additional things to check:
以下是一些需要检查的附加事项:
- Make sure that the Nginx configuration file is correctly configured to serve the contents of the directory /var/www/html/.
- Make sure that the PHP-FPM configuration file is correctly configured to allow the web server to execute PHP scripts.
If you are still having trouble, you can consult the documentation for Nginx and PHP-FPM for more information.
如果您仍然有问题,可以参考Nginx和PHP-fpm的文档以获取更多信息。
更多回答
But php-fpm is in another docker container, so the webserver content is in the var/www/html of the other server, not in the one of the nginx, right?
但是php-fpm在另一个docker容器中,所以Web服务器内容在另一个服务器的var/www/html中,而不是在nginx中的那个服务器中,对吗?
我是一名优秀的程序员,十分优秀!