Nginx localhost configuration, open Directory browsing

Source: Internet
Author: User
Tags phpmyadmin
Before using Apache, sometimes access to localhost, actually prompted 403 access die, but in a few days and can (no modification of any configuration of the case), very strange, this situation, no matter how to modify the configuration is prompt 403 no permission! The odds are low but can't be solved.

After changing the nginx there is no longer such a problem, autoindex with very cool.

Configuration file localhost.conf:

Where the Http://localhost/phpmyadmin/alias alias to phpmyadmin!

server {Listen       80;server_name  localhost 127.0.0.1 ""; root d:/localhost;index  index.html index.htm Index.php;autoindex on; Autoindex_exact_size off;autoindex_localtime on;location/phpmyadmin {root d:/wamp/apps/phpmyadmin4.1.14;location ~ \ . php$ {try_files $uri =404;fastcgi_pass   127.0.0.1:9000;fastcgi_index  index.php;fastcgi_param  SCRIPT_ FILENAME  $document _root$fastcgi_script_name;include        fastcgi_params;    }} Location ~ \.php$ {try_files $uri =404;fastcgi_pass   127.0.0.1:9000;fastcgi_index  Index.php;fastcgi_param  script_filename  $document _root$fastcgi_script_name;include        fastcgi_params;    } #error_page  404              /404.html;# Redirect Server error pages to the static Page/50x.html#error_page   500 502 50 3 504  /50x.html;location =/50x.html {root   html;} Location ~/\. (Ht|svn|git) {Deny All;}}

The above describes the nginx localhost configuration, open Directory browsing, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.