首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >nginx,我可以看到是`index.php`在幼虫中的测试

nginx,我可以看到是`index.php`在幼虫中的测试
EN

Stack Overflow用户
提问于 2018-06-22 05:03:57
回答 1查看 79关注 0票数 0

现在,我的服务器上安装了laravel 5.6,所以它对公众“部署”是开放的。当我将nginx配置为使用laravel的公共目录并重新启动所有内容时,我所能看到的就是使用下载和保存选项对index.php进行测试。

nginx的访问日志:

162.158.22.173 -- 21/Jun/2018:23:18:39 +0000 "GET / HTTP/1.1“”175902 "-“"Mozilla/5.0 (Windows NT 10.0;Win64;x64) AppleWebKit/537.36 (KHTML,如Gecko) Chrome/67.0.3396.87Safari/537.36”

/etc/nginx/sites-available/laravel:

server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/lib/jenkins/workspace/ytl/public;

# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;

server_name 157.32.4.241;

#location / {
        try_files $uri $uri/ /index.php;

location ~ \.php$ {
    #try_files $uri /index.php =404;
try_files $uri $uri/ /index.php?$args;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

    location ~ /\.ht {
        deny all;
    }

location ~ /git(/.*) {
    client_max_body_size 0; # Git pushes can be massive, just to make sure nginx doesn't suddenly cut the connection add this.
    auth_basic "Git Login"; # Whatever text will do.
    auth_basic_user_file "/var/www/html/git/htpasswd";
    include /etc/nginx/fastcgi_params; # Include the default fastcgi configs
    fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; # Tells fastcgi to pass the request to the git http backend executable
    fastcgi_param GIT_HTTP_EXPORT_ALL "";
    fastcgi_param GIT_PROJECT_ROOT /var/www/html/git; # /var/www/git is the location of all of your git repositories.
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param PATH_INFO $1; # Takes the capture group from our location directive and gives git that.
    fastcgi_pass  unix:/var/run/fcgiwrap.socket; # Pass the request to fastcgi
}

现在:当我打开url :它给我index.php文件。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-22 07:43:08

nginx无法写入存储文件夹,请尝试chmod 777 path/to/storage

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50977402

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档