• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

请问在阿里云/myweb 下挂载了一块数据盘,配置完nginx后 为何提示 文件找不到

php 搞代码 3年前 (2022-01-25) 16次浏览 已收录 0个评论
文章目录[隐藏]

阿里云用了镜像装好运行环境 nginx作为服务器
我没把项目部署在系统盘
又新挂了一个数据盘在/myweb下

我更新nginx 的配置文件

<code>conf</code><code>server {        listen       80;        server_name  112.xxx.xxx.xx7;        rewrite_log on;        root   /myweb/test/public;        index index.php  index.html index.htm;        location / {                index  index.php index.html index.htm;        }        location ~ \.php($|/) {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_split_path_info ^(.+\.php)(.*)$;            fastcgi_param   PATH_INFO $fastcgi_path_info;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }        if (!-e $request_filename) {            rewrite ^/(.*)$ /index.php/$1 last;            break;        }        location ~ /\.ht {                deny  all;        }}</code>

却说找不到文件 为何呢?请问 谢谢了

回复内容:

阿里云用了镜像装好运行环境 nginx作为服务器
我没把项目部署在系统盘
又新挂了一个数据盘在/myweb下

我更新nginx 的配置文件

<code>conf</code><code>server {        listen       80;        server_name  112.xxx.xxx.xx7;        rewrite_log on;        root   /myweb/test/public;        index index.php  index.html index.htm;        location / {                index  index.php index.html in<b>%本文@来源gao@!dai!ma.com搞$$代^@码!网</b><strong>搞代gaodaima码</strong>dex.htm;        }        location ~ \.php($|/) {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_split_path_info ^(.+\.php)(.*)$;            fastcgi_param   PATH_INFO $fastcgi_path_info;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }        if (!-e $request_filename) {            rewrite ^/(.*)$ /index.php/$1 last;            break;        }        location ~ /\.ht {                deny  all;        }}</code>

却说找不到文件 为何呢?请问 谢谢了

能不能详述你挂载磁盘的步骤?我觉得多数问题出现在这里。另外你这个配置文件是写在哪里的? /etc/nginx/site-a…/default ?

是不是访问 /index.php 然后提示File not found


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:请问在阿里云/myweb 下挂载了一块数据盘,配置完nginx后 为何提示 文件找不到

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址