nginx不识别index.php,nginx解析不到laravel/public里的index.php文件

news/2024/7/7 12:58:10

我将/etc/nginx/sites-available/default里面把root路径改成里/var/www/html/laravel/public了,但是运行结果是403,一开始以为是文件夹权限不够,照着网上说都storage和vendor都权限都可以读写里还是不行。 哪位大神帮我看看啊!

下面是我的nginx配置文件:

server {

listen 80 default_server;

listen [::]:80 default_server;

# SSL configuration

#

# listen 443 ssl default_server;

# listen [::]:443 ssl default_server;

#

# Note: You should disable gzip for SSL traffic.

# See: https://bugs.debian.org/773332

#

# Read up on ssl_ciphers to ensure a secure configuration.

# See: https://bugs.debian.org/765782

#

# Self signed certs generated by the ssl-cert package

# Don't use them in a production server!

#

# include snippets/snakeoil.conf;

root /var/www/html/laravel/public;

# Add index.php to the list if you are using PHP

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {

# First attempt to serve request as file, then

# as directory, then fall back to displaying a 404.

try_files $uri $uri/ =404;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

include snippets/fastcgi-php.conf;

# With php7.0-cgi alone:

# fastcgi_pass 127.0.0.1:9000;

# With php7.0-fpm:

fastcgi_pass unix:/run/php/php7.0-fpm.sock;

}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

location ~ /\.ht {

deny all;

}

}

# Virtual Host configuration for example.com

#

# You can move that to a different file under sites-available/ and symlink that

# to sites-enabled/ to enable it.

#

#server {

# listen 80;

# listen [::]:80;

#

# server_name example.com;

#

# root /var/www/html/laravel/public;

# index index.html;

#

# location / {

# try_files $uri $uri/ =404;

# }

#}


http://www.niftyadmin.cn/n/712165.html

相关文章

web前端学习(三十五)——JavaScript事件、字符串及运算符的相关设置

1.JS事件 HTML 事件是发生在 HTML 元素上的事情。当在 HTML 页面中使用 JavaScript 时, JavaScript 可以触发这些事件。HTML 事件可以是浏览器行为,也可以是用户行为。 以下是 HTML 事件的实例: HTML 页面完成加载HTML input 字段改变时HTML …

印度超本地社交网络Pulse获20万美元种子轮融资

Facebook开始只是个大学和职场应用,我在读大学时,它正处于向一个商业必需品转化的发展尖端。也正是因为这个转化,我发现自己越来越离不开网络。 那时,我尝试了很多聊天应用和在线新闻网站去表达我的看法。后来由于应用发来的推送过…

tab

2019独角兽企业重金招聘Python工程师标准>>> <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>TAb</title> </head> <body> <div class"tab"> <ul class"tab-hd&q…

destroy重新打开 eayui_怎样处理jQuery EasyUI 已打开Tab重新加载问题

如何解决jQuery EasyUI 已打开Tab重新加载问题先给大家说下我的需求&#xff0c;如下&#xff1a;点击左侧已经打开的tab可以刷新重新加载datagrid。也就是说解决easyui 左侧tab重新刷新加载问题实现。实现如下&#xff1a;function addTab(subtitle, url) {if (!$(#tabs).tabs…

java算法判断链表有没有闭环,前端算法系列之二:数据结构链表、双向链表、闭环链表、有序链表...

前言上一次我们讲到了数据结构&#xff1a;栈和队列&#xff0c;并对他们的运用做了一些介绍和案例实践&#xff1b;我们也讲到了怎么简单的实现一个四则运算、怎么去判断标签是否闭合完全等等&#xff0c;anyway&#xff0c;今天接着和大家介绍一些数据结构&#xff1a;上一篇…

web前端学习(三十六)——JavaScript重要语句(if...else if...else、switch、for、while、break、continue)的相关设置

1.JS条件语句 条件语句用于基于不同的条件来执行不同的动作。 通常在写代码时&#xff0c;您总是需要为不同的决定来执行不同的动作。您可以在代码中使用条件语句来完成该任务。 在 JavaScript 中&#xff0c;我们可使用以下条件语句&#xff1a; if 语句 - 只有当指定条件为 t…

Button的四种点击事件

1.XML文件布局<Buttonandroid:id"id/bt1"android:layout_width"wrap_content"android:layout_height"wrap_content"android:onClick"doClick"android:text"XML添加doClick"android:layout_above"id/bt2"androi…

zabbix 安装 部署 网络监控

zabbix 部署详解zabbix简介是一个高度集成的网络监控解决方案&#xff0c;可以提供企业级的开源分布式监控解决方案&#xff0c;由一个国外的团队持续维护更新&#xff0c;软件可以自由下载使用&#xff0c;运作团队靠提供收费的技术支持赢利Zabbix主要功能&#xff1a;- CPU负…