Home » Php » i want to access index.php in folder outside root (nginx windows)

i want to access index.php in folder outside root (nginx windows)

Posted by: admin February 25, 2020 Leave a comment

Questions:

folder structure

---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;
        }   
    }
}

i want to enter http://127.0.0.1/phpmyadmin and it will redirect to “phpmyadmin” folder (outside root)

for now i have to put “phpmyadmin” folder in “www” folder

if you guys have solution please tell me, thanks

How to&Answers: