Nginx圖片處理相關(guān)技巧介紹
Nginx圖片處理一個網(wǎng)管員必備的數(shù)據(jù)處理方式,其中不斷更新的問題就讓我們很頭痛,接下來我們就看看Nginx圖片處理的相關(guān)方法。html等靜態(tài)的東西.其它動態(tài)由apache處理.因此apache也需要做一些參數(shù)調(diào)整.設(shè)置圖片等過期時間.緩解請求。
如果源與Nginx在同一臺機(jī)器建議使用如下方法:
- location / {
- proxy_pass http://192.168.1.4:8099/;
- proxy_redirect default ;
- }
針對不同的目錄進(jìn)行代理把下面的配置放到根目錄代理的上面
- location /linuxtone/ {
- proxy_pass http://192.168.1.4:8099/linuxtone/;
- proxy_redirect default ;
- }
Nginx圖片處理源配置
- <VirtualHost 192.168.1.4:8099>
- ServerAdmin liuyu105#gmail.com
- DocumentRoot /date/wwwroot/linuxtone
- ServerName bbs.linuxtone.com
- ErrorLog logs/linuxtone_error_log
- CustomLog "|/usr/local/sbin/cronolog logs/linuxtone_access
_log.%Y%m%d" combined- </VirtualHost>
Nginx圖片處理源的優(yōu)化
1 apache-mpm.conf
- <IfModule mpm_prefork_module>
- StartServers 15
- MinSpareServers 15
- MaxSpareServers 30
- ServerLimit 2536
- MaxClients 2048
- MaxRequestsPerChild 1500
- </IfModule>
2 apache-keepalive
- Timeout 120 #與 nginx 的保持一至
- KeepAlive On
- MaxKeepAliveRequests 400
- KeepAliveTimeout 7
以上就是對Nginx圖片處理一些小技巧的介紹,希望大家有所收獲。
【編輯推薦】