linux + nginx做静态网页服务器

如何配置nginx静态文件服务器

server {

    listen 999;

    server_name test;

    location / {

        root /temp/; #指定文件所在目录

        autoindex on;#开启目录的关键命令

    }


如果做反向代理 只需要在 location中添加

    proxy_pass http://www.renren.com;


另外注意 linux 中111端口是被系统保留,如果用ngnix监听111端口的话,是不会生效的。

猜你喜欢

转载自blog.51cto.com/1101837/2453440