0
基本上即时尝试设置和别名的Nginx。Nginx的403错误与PHP使用PHP-FPM
目前我有我的本地主机服务器设置为:/ usr/share/nginx/html,它工作正常。
我尝试添加内部域翻译:misemestrei.dom到/ home/frhec /文件夹,但我得到错误403
我已经试图改变用户所有权的“http”,还可以设置用户permisions到755,但我仍然得到相同的错误。
弥nginx.conf是:
user http;
worker_processes auto;
worker_cpu_affinity auto;
pcre_jit on;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
events {
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
aio threads;
server_tokens off;
charset utf-8;
keepalive_timeout 65;
#Omited localhost server configuration, it's similar#
server {
listen 80;
server_name misemestrei.dom;
client_max_body_size 25M;
location/{
root /home/frhec/folder;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/frhec/folder;
}
location ~ \.(php|html|htm)$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
root /home/frhec/folder;
fastcgi_index index.php;
include fastcgi.conf;
}
include sites-enabled/*;
}
}
我的/ etc/hosts如下所示:
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
127.0.0.1 misemestrei.dom misemestrei.dom
::1 localhost.localdomain localhost
# End of file
和文件夹的样子:
drwxr-xr-x 4 http http 4096 Aug 12 21:02 .
drwxr-xr-x 4 http http 4096 Aug 11 15:56 ..
-rwxr-xr-x 1 frhec users 61 Aug 11 15:15 composer.json
-rwxr-xr-x 1 frhec users 2492 Aug 11 15:15 composer.lock
drwxr-xr-x 2 frhec users 4096 Aug 12 21:07 .idea
-rwxr-xr-x 1 http http 0 Aug 12 21:02 index.php
-rwxr-xr-x 1 http http 367 Aug 11 15:21 mongodb01.php
drwxr-xr-x 4 frhec users 4096 Aug 11 15:15 vendor
我使用Antergos (Arch-Linux)
谢谢
检查nginx的错误日志..有将有更多的细节 – fmodos
已经做到了基本上说的index.php文件未找到 – HFR1994