Home > Article > Backend Development > Set up nginx and access the root directory
我用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>
搞定!
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });以上就介绍了设置nginx,访问根目录,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。