亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

虛擬機域名指向共享文件夾404的問題

虛擬機域名指向共享文件夾404的問題

LEATH 2018-08-10 15:12:04
環境:vmwarephp7nginxmysqllaravel掛載目錄 /mnt/hgfs/WWW/test/l/public首先是/usr/local/nginx/conf/vhost 下的test.com.confserver{    listen 80;    #listen [::]:80;     server_name test.com test2.com;    index index.html index.htm index.php default.html default.htm default.php;    root  /mnt/hgfs/WWW/test/l/public;    include rewrite/laravel.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-pathinfo.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; }接下來是windows的host文件192.168.0.16 test.com問題:此時使用游覽器訪問test.com出現了404,域名指向掛載目錄是行不通的嗎,還是我配置錯了?求大神
查看完整描述

1 回答

?
婷婷同學_

TA貢獻1844條經驗 獲得超8個贊

缺少nginx 與 php 通訊的地方

   location ~ \.php(.*)$  {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            fastcgi_param  PATH_INFO  $fastcgi_path_info;            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;            include        fastcgi_params;
        }


查看完整回答
反對 回復 2018-08-12
  • 1 回答
  • 0 關注
  • 910 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號