In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Install Nginx#apt-get install nginx#yum install nginx to view the installation path # whereis nginx configure nginx location ~. *\. (gif | jpg | jpeg | png) ${expires 24h; root / data/www/images/;# specifies the image storage path access_log / data/www/images/nginx/logs/images.log;# picture log path proxy_store on Proxy_store_access user:rw group:rw all:rw; proxy_temp_path / data/www/images/;# proxy temporary path proxy_redirect off; proxy_set_header Host 127.0.0.1; proxy_set_header X-Real-IP $remote_addr Proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 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:8088;# proxy access address}}
Note: / data/www/images/nginx/logs/, / data/www/images paths must be created.
It is a good idea to test the configuration file of nginx before restarting the nginx service.
Test profile # nginx-t
Note: nginx is configured by me with a global soft connection, so there can be no absolute path.
Restart the nginx service # nginx-s reload test access picture
Note: copy the prepared image to / data/www/images, open the browser and access it directly. Note that the port is configured as 8088.
The problem encountered is to restart the nginx service and report an error
The image path configured in the 1.nginx.conf file will report an error if it is not created in advance. Therefore, it is recommended that you execute the profile test command: nginx-t before restarting the service.
2.nginx: [error] invalid PID number "" in "/ usr/local/nginx/logs/nginx.pid". This error is caused by the fact that / usr/local/nginx/logs/nginx.pid does not exist or the content is empty, so we can only execute the following command:
# / usr/local/nginx/sbin/nginx-c / usr/local/nginx/conf/nginx.conf
Restart to complete, and then access.
Failed to access the picture server
Set path permissions, turn off the firewall, and revisit the picture server.
# chmod 777-R / data/www/images/
# ufw disable
Note: because I have a linux mint system, my on and off service is to turn off and turn on the firewall through ufw disable and ufw enable.
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: 0
*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.