我想访问root(nginx Windows)外的文件夹中的index.php

梦想

文件夹结构

---C:\
------webserver
---------------mysql
---------------nginx
---------------php
---------------phpMyAdmin <<<<<<<< this is folder i want to access
---------------www <<<<<<<< this is root
---------------run.bat
---------------stop.bat

nginx.conf

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        root   C:\webserver\www;
        index  index.php index.html index.htm;

        location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        }   
    }
}

我想输入http://127.0.0.1/phpmyadmin,它将重定向到“ phpmyadmin”文件夹(外部根目录)

现在我必须将“ phpmyadmin”文件夹放在“ www”文件夹中

如果你们有解决方案,请告诉我,谢谢

梦想
server {
    listen      80;
    server_name domain.tld;
    root        /var/www/domain.tld/html;
    index       index.php index.html index.htm;

    location / { 
    }

    location /nginx_status {
        stub_status on;
        access_log  off;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ^~ /phpmyadmin {
        root /var/www;

        location ~ \.php$ {
            try_files $uri =404;
            include fastcgi_params;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
    }
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

我文件夹中的PHP路径

如何使NGINX通过index.php执行文件夹中的所有URL

nginx:如何提供子文件夹的/index.php?

nginx - php-fpm 如果 nginx 文件夹中不存在 index.php 则禁止

如果我在文件夹中,则读取 php 文件

我想在PHP中创建文件夹导航

我无法在Ubuntu中访问Root的主文件夹

我将如何制作php文件夹并将文件创建到先前创建的文件夹中

忽略子文件夹中的index.php

网站内部文件夹访问重定向到index.php

PHP在数据库和我的根文件夹中的文件夹中上载

公用文件夹访问控制器功能中的typo3 php文件

php。我想允许用户从任何文件夹将文件添加到表单

我的php会话文件夹中不需要的会话文件

Windows 中我的用户文件夹中的奇怪文件夹

php composer无法在public_html文件夹中访问

文件夹中的PHP文件计数

上传图片并保存到我的php文件夹中

PHP:如何在.htaccess中隐藏我的应用程序文件夹

使用 PHP 邮件发送的邮件未显示在我的邮件已发送文件夹中

PHP __DIR__向下文件夹“ ROOT PATH”

如何按原样使用文件夹内或文件夹外的所有php文件

Windows XP中的C#访问用户文件夹

使用python访问Windows中的共享文件夹

将对php的访问权限授予/ home文件夹

无法访问子文件夹| PHP框架

通过PHP访问Mac上的共享文件夹

使用ubuntu恢复我在Windows中锁定的文件夹?

laravel - index.php 不能要求 public_html 文件夹中的特定文件