【发布时间】:2018-07-11 06:10:15
【问题描述】:
我已经将我的 laravel 项目上传到远程 linux 主机。这个项目在我本地的 windows homestead 上运行良好。但是当我把它放在 linux 主机上时,它不起作用。 项目根目录是 :/var/www/html/blog 。 nginx 配置如下:
`server
{
listen 80;
#listen [::]:80;
server_name www.antichina.us ;
index index.html index.htm index.php default.html default.htm default.php;
root /var/www/html/blog/public;
# include other.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
`
当我使用域访问项目时,(http://mydomain),it 给出http 500 错误。但是当我在nginx 配置文件中将root 设置为/var/www/html/blog 时,项目的索引页是访问:http://mydomain/public,其他路由都返回404错误。
我已经尝试了我的方法,但似乎没有一个有效。任何可以帮助我吗?谢谢!
【问题讨论】:
-
你的标题说有错误,但你没有说是什么。
-
当我使用域访问项目时,(mydomain),it 给出 http 500 错误。但是当我在 nginx 配置文件中将根设置为 /var/www/html/blog 时,索引项目页面正在工作,访问:mydomain/public,其他路由都返回404错误。