欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

如何配置nginx作為靜態(tài)文件托管服務器

 更新時間:2024年01月31日 15:01:24   作者:andy_lau_andy  
這篇文章主要介紹了如何配置nginx作為靜態(tài)文件托管服務器的相關資料,下載nginx在windows上是個壓縮包,解壓后,使用命令行輸入nginx進行啟動,感興趣的朋友跟隨小編一起看看吧

下載nginx

windows上是個壓縮包

解壓后, 使用命令行輸入 nginx 進行啟動

nginx -s stop 進行停止
nginx -s status 查看狀態(tài)
可以配置一下環(huán)境變量

主要是配置文件, windows的nginx配置文件在 conf文件夾下

在http標簽下 添加如下配置


其他地方不用更改,保持原樣即可,
以下是整個配置文件的參考

#user  nobody;
worker_processes  1;
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#pid        logs/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
    #access_log  logs/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    #gzip  on;
	  server {
	    listen 80;
	    server_name example.com;
	    root G:\media;
	    index index.html;
	    location / {
	        try_files $uri $uri/ =404;
	    }
	}
    }

到此這篇關于配置nginx作為靜態(tài)文件托管服務器的文章就介紹到這了,更多相關nginx靜態(tài)文件托管服務器內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論