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端口的話,是不會生效的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章