盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

nginx设置访问图片路径以及html静态页面的调取方法

时间:2024/5/4作者:未知来源:盾怪网教程人气:

[摘要]这篇文章主要介绍了详解nginx配置访问图片路径以及html静态页面的调取方法,现在分享给大家,也给大家做个参考。给大家讲一个快速配置nginx访问图片地址,以及访问html静态页面的配置。1.实验...
这篇文章主要介绍了详解nginx配置访问图片路径以及html静态页面的调取方法,现在分享给大家,也给大家做个参考。

给大家讲一个快速配置nginx访问图片地址,以及访问html静态页面的配置。

1.实验环境

首先随便某个路径下创建相应的目录。如图下

nginx配置访问图片路径以及html静态页面的调取方法

2.在里面放自定义的html或者图片。

3.nginx配置

user root;  
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 localhost;#本机  
  
    charset utf-8;  
  
    #access_log logs/host.access.log main;  
  
  location ~ .*\.(gif

关键词:nginx设置访问图片路径以及html静态页面的调取办法




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版