Home > Backend Development > PHP Tutorial > Set up nginx and access the root directory

Set up nginx and access the root directory

WBOY
Release: 2016-07-29 09:02:11
Original
1901 people have browsed it

我用docker搭建的lnmp环境,外部访问不了网站目录,怎么设置nginx呢?
搜索了下,只要加上 autoindex on; 就ok!

<code>        location / {
            root   /usr/share/nginx/html/;
            <span>index</span><span>index</span>.php <span>index</span>.html <span>index</span>.htm;

            <span>if</span> (!-e <span>$request_filename</span>) {
                rewrite ^<span>/(.*)$ /index</span>.php/<span>$1</span><span>last</span>;
            }
            autoindex on;
        }
</code>
Copy after login

搞定!

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了设置nginx,访问根目录,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template