日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

nginx配置文服

發布時間:2023/12/13 综合教程 29 生活家
生活随笔 收集整理的這篇文章主要介紹了 nginx配置文服 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

修改nginx.conf

添加如下內容

autoindex on; # 顯示目錄
autoindex_exact_size on; # 顯示文件大小
autoindex_localtime on; # 顯示文件時間

#  power by www.phpStudy.net 
#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;
    #tcp_nodelay on;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 128k;
  fastcgi_buffers 4 128k;
  fastcgi_busy_buffers_size 256k;
  fastcgi_temp_file_write_size 256k;

  #gzip  on;
  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 32k;
  gzip_http_version 1.1;
  gzip_comp_level 2;
  gzip_types       text/plain application/x-javascript text/css application/xml;
  gzip_vary on;
  gzip_disable "MSIE [1-6].";

  server_names_hash_bucket_size 128;
  client_max_body_size     100m; 
  client_header_buffer_size 256k;
  large_client_header_buffers 4 256k;
  underscores_in_headers on;
  
  autoindex on; # 顯示目錄
  autoindex_exact_size on; # 顯示文件大小
  autoindex_localtime on; # 顯示文件時間
  
  root "F:/work/workspace/smart/spring-smart-html/";
  index  index.html index.htm;		
  
 server {
        listen       80;
        server_name  192.168.64.1 192.168.0.104 127.0.0.1;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;   
		
 	location /smart/ {
        proxy_pass http://localhost:8081/spring-smart-web/smart/;
        proxy_set_header   Host    $host;
        proxy_set_header   X-Real-IP   $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_connect_timeout 300;
		proxy_send_timeout 300;
		proxy_read_timeout 300;
    }		
	
	location ~ .*.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css|less|map|eot|svg|ttf|woff|woff2|cab|scss|otf|exe|pdf|doc|xlsx)$ {	
		root "F:/work/workspace/smart/spring-smart-html/";
		index  index.html index.htm;
		expires 1d;
    }	
}
	include vhost/*.conf;
}

  

訪問

總結

以上是生活随笔為你收集整理的nginx配置文服的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。