In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the nginx configuration access picture path and html static page access method related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone after reading this nginx configuration access picture path and html static page call method article will have a harvest, let's take a look at it.
1. Experimental environment
First of all, create the corresponding directory under any path. As shown in the picture
two。 Put custom html or pictures in it.
3.nginx configuration
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 80th # port number server_name localhost;# native charset utf-8; # access_log logs/host.access.log main; location ~. *\. (gif | jpg | jpeg | png) ${expires 24h; root / home/images/;# specifies the image storage path access_log / usr/local/websrv/nginx-1.9.4/logs/images.log # Log storage path proxy_store on; proxy_store_access user:rw group:rw all:rw; proxy_temp_path / home/images/;# image access path proxy_redirect off; proxy_set_header host 127.0.0.1; client_max_body_size 10m; client_body_buffer_size 1280k; proxy_connect_timeout 900 Proxy_send_timeout 900; proxy_read_timeout 900; proxy_buffer_size 40k; proxy_buffers 40 320k; proxy_busy_buffers_size 640k; proxy_temp_file_write_size 640k; if (!-e $request_filename) {proxy_pass http://127.0.0.1; # default port 80}} location / {root / home/html; # html access path index index.html index2.htm; # html file name} error_page 404 / 404.html
4. Check to see if there is an error in the compilation, and if there is no error, the setting is successful.
5. If you visit nginx, you can access the address of the image you visit.
6. When accessing a custom html.
This is the end of this article on "nginx configuration to access picture paths and how to access html static pages". Thank you for reading! I believe that everyone has a certain understanding of the "nginx configuration access picture path and html static page access method" knowledge, if you want to learn more knowledge, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 209
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.