如何配置nginx靜態文件服務器
server {
listen 999;
server_name test;
location / {
root /temp/; #指定文件所在目錄
autoindex on;#開啓目錄的關鍵命令
}
}
如果做反向代理 只需要在 location中添加
proxy_pass http://www.renren.com;
另外注意 linux 中111端口是被系統保留,如果用ngnix監聽111端口的話,是不會生效的。
如何配置nginx靜態文件服務器
server {
listen 999;
server_name test;
location / {
root /temp/; #指定文件所在目錄
autoindex on;#開啓目錄的關鍵命令
}
}
如果做反向代理 只需要在 location中添加
proxy_pass http://www.renren.com;
另外注意 linux 中111端口是被系統保留,如果用ngnix監聽111端口的話,是不會生效的。