Hier ist Inhalt meines nginx.nginx 403 verboten Fehler + mac + Laravel
Meine aktuelle Zugriffs-URL ist http://localhost/lampi/, und ich erhalte die Antwort 403 forbidden
.
Mein Servers documentroot ist/Library/WebServer/Documents /.
Wenn ich http://localhost/ zugreifen, es zeigt ok. Ich kann auch den Inhalt der Seite index.html sehen.
Ich weiß nicht, was los ist. Ich habe die Top 10 Seiten im Stackoverflow überprüft.
server {
server_name localhost;
access_log /var/log/nginx/nginx.host.access.log main;
root /Library/WebServer/Documents/;
location/{
#root html;
index index.html index.htm index.php;
}
location /lampi {
#autoindex on;
if (!-e $request_filename){
rewrite ^/lampi/(.*)$ /lampi/index.php?s=$1 last;
}
}
location ~ \.php$ {
include /usr/local/etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /Library/WebServer/Documents/lampi/$fastcgi_script_name;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_param HTTP_PROXY "";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
#location /images/ {
# root /usr/local/var/www;
#}
}