修改nginx.conf

添加如下内容

autoindex on; # 显示目录
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间

  1. # power by www.phpStudy.net
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8.  
  9. #pid logs/nginx.pid;
  10.  
  11. events {
  12. worker_connections 1024;
  13. }
  14.  
  15. http {
  16. include mime.types;
  17. default_type application/octet-stream;
  18.  
  19. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  20. '$status $body_bytes_sent "$http_referer" '
  21. '"$http_user_agent" "$http_x_forwarded_for"';
  22.  
  23. access_log logs/access.log main;
  24.  
  25. sendfile on;
  26. #tcp_nopush on;
  27.  
  28. #keepalive_timeout 0;
  29. keepalive_timeout 65;
  30. #tcp_nodelay on;
  31. fastcgi_connect_timeout 300;
  32. fastcgi_send_timeout 300;
  33. fastcgi_read_timeout 300;
  34. fastcgi_buffer_size 128k;
  35. fastcgi_buffers 4 128k;
  36. fastcgi_busy_buffers_size 256k;
  37. fastcgi_temp_file_write_size 256k;
  38.  
  39. #gzip on;
  40. gzip on;
  41. gzip_min_length 1k;
  42. gzip_buffers 4 32k;
  43. gzip_http_version 1.1;
  44. gzip_comp_level 2;
  45. gzip_types text/plain application/x-javascript text/css application/xml;
  46. gzip_vary on;
  47. gzip_disable "MSIE [1-6].";
  48.  
  49. server_names_hash_bucket_size 128;
  50. client_max_body_size 100m;
  51. client_header_buffer_size 256k;
  52. large_client_header_buffers 4 256k;
  53. underscores_in_headers on;
  54.  
  55. autoindex on; # 显示目录
  56. autoindex_exact_size on; # 显示文件大小
  57. autoindex_localtime on; # 显示文件时间
  58.  
  59. root "F:/work/workspace/smart/spring-smart-html/";
  60. index index.html index.htm;
  61.  
  62. server {
  63. listen 80;
  64. server_name 192.168.64.1 192.168.0.104 127.0.0.1;
  65. #charset koi8-r;
  66. #access_log logs/host.access.log main;
  67.  
  68. location /smart/ {
  69. proxy_pass http://localhost:8081/spring-smart-web/smart/;
  70. proxy_set_header Host $host;
  71. proxy_set_header X-Real-IP $remote_addr;
  72. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  73. proxy_connect_timeout 300;
  74. proxy_send_timeout 300;
  75. proxy_read_timeout 300;
  76. }
  77.  
  78. 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)$ {
  79. root "F:/work/workspace/smart/spring-smart-html/";
  80. index index.html index.htm;
  81. expires 1d;
  82. }
  83. }
  84. include vhost/*.conf;
  85. }

  

访问

nginx配置文服的更多相关文章

  1. 史上最全的Nginx配置文档

    Nginx是一个异步框架的Web服务器,也可以用作反向代理,负载平衡器 和 HTTP缓存.该软件由Igor Sysoev 创建,并于2004年首次公开发布.同名公司成立于2011年,以提供支持.Ngi ...

  2. Nginx配置文档具体解释

    Nginx的配置文档具体解释.在这儿做个总结,以便以后使用的时间查看. 下面大部分自己整理.部分来自參考 #设置用户 #user  nobody; #启动进程数(一般和server的CPU同样) #能 ...

  3. Rhel6-cacti+nagios+ganglia(nginx)配置文档

    (lnmp平台) 系统环境: rhel6 x86_64 iptables and selinux disabled 主机: 192.168.122.185 server85.example.com 1 ...

  4. Nginx配置文档

    转https://www.cnblogs.com/hunttown/p/5759959.html

  5. nginx配置 的话注意几点 1.错误时注意看log 2.天威证书的话,有文档按照其文档一步步配置即可;3每句话的结尾注意千万别丢掉分号

    nginx配置 的话注意几点 1.错误时注意看log  2.天威证书的话,有文档按照其文档一步步配置即可:3每句话的结尾注意千万别丢掉分号:4.配置https时 其转发可以转发到http上 pass_ ...

  6. 死磕nginx系列--配置文档解读

    nginx配置文件主要分为四个部分: main(全局设置) http ( ) upstream(负载均衡服务器设置) server(主机设置) location(URL匹配特点位置的设置) serve ...

  7. nginx 安全配置文档

    1.配置文档中有多处明确写出了nginx的配置文件路径,该路径是测试环境中的路径,线上系统的nginx配置文件与文档中所写的路径可能不一样,在进行相关配置时,应以线上配置文件的实际路径为准. 线上系统 ...

  8. (转)nginx 安全配置文档

    原文:https://www.cnblogs.com/heaven-xi/p/9961357.html#top 1.配置文档中有多处明确写出了nginx的配置文件路径,该路径是测试环境中的路径,线上系 ...

  9. Nginx 1.10.1 编译、配置文档(支持http_v2,TLSv1.2,openssl v1.0.2)

    1.安装常用工具及基础包: [root@localhost /]# yum -y install wget git vim make gcc gcc-c++ openssl-devel [root@l ...

随机推荐

  1. 可访问范围 与 visual 或 abstract “修饰符”

    protected:在当前类内定义,则在当前类“内部”可以调用,则在 派生子类"内部" 也可以调用 private,除去,在 派生子类"内部" 也可以调用,其它 ...

  2. android-------- 常用且应该学习的框架

    今天来分享一下一些常用的库,在Github 上 star数也是很高的,开发中也是很常用的: 简单的分享一下,一起学习. http://www.xiufm.com/blog-1-944.html 框架名 ...

  3. android------Eclipse Memory Analyzer (MAT)

    简单介绍 MAT(Memory Analyzer Tool),一个基于Eclipse的内存分析工具,是一个快速.功能丰富的JAVA heap分析工具,它可以帮助我们查找内存泄漏和减少内存消耗. 使用内 ...

  4. linux网络配置命令(二)——ip

    ip命令 查看/设置路由.设备.路由策略和渠道信息 格式 ip [ OPTIONS ] OBJECT { COMMAND | help } OBJECT := { link | addr | addr ...

  5. python中list、tuple、dict、set的使用

    1.list列表 list是一种可变的,有序的列表,可以随时添加和删除其中的元素. 其格式如下:list-name=[element1,element2,....] >>> nums ...

  6. date命令说明

    基本使用格式: date [-d "time-to-display"] +"format-to-display" -d指定要显示的时间,如果不指定默认为当前时间 ...

  7. [转]每天一个linux命令(44):top命令

    top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.下面详细介绍它的使用方法.top是一个动态显示过程,即可以通过用户按键来不断刷新 ...

  8. 码云git使用一(上传本地项目到码云git服务器上)

    主要讲下如果将项目部署到码云git服务器上,然后使用studio导入git项目,修改本地代码后,并同步到码云git上面. 首先:我们在码云上注册账号并登陆.官网(https://git.oschina ...

  9. etymon word air aero aeri aer ag agreement walk joint trick skill chief forget out~1

      1● air 2● aero 3● aeri 4● aer 空气 充气       1● ag     做,代理做   =====>agency       1● agr 2● agri 3 ...

  10. 使用AndroidStudio运行eclipse开发的app项目

    由于AS和eclipse开发的APP项目格式不同,所以直接用AS运行eclipse项目是行不通的. 下面给大家讲解一下如何在AS上成功运行eclipse项目 首先有这么个eclipse项目文件夹 然后 ...