Nginx 配置文件服務器

    server {      
		listen       8080;   #監聽端口
        server_name  127.0.0.1;   #監聽地址  
		root  web; # 在nginx文件夾下創建web文件夾,並設置爲root,將靜態文件放置在此文件夾下即可訪問
		#啓用支持websocket連接
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
		proxy_read_timeout   3600s; # 超時設置
		
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        
      	# 配置文件服服務器
	    location /fileServer {
            alias D:\Application;
            autoindex on;# 顯示目錄
            autoindex_exact_size on;# 顯示文件大小
            autoindex_localtime on;# 顯示文件時間
            allow all;
            index  index.html index.htm;
        }
		
		# 配置靜態文件轉發
	    location /crm{
			try_files $uri $uri/ /crm/index.html;        
		}
		
		location / {
           root   html;
           index  index.html;
        }

        #error_page  404              /404.html;
    }

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