您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“nginx配置優(yōu)化實(shí)例分析”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“nginx配置優(yōu)化實(shí)例分析”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識(shí)吧。
代碼如下:
[root@xxxxxxxxxxxxxx ~]# cat /usr/local/nginx/conf/nginx.conf user nobody; worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 10240; accept_mutex on; multi_accept on; use epoll; } 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 30; keepalive_requests 50000; send_timeout 15; gzip on; gzip_min_length 1024; gzip_buffers 16 8k; gzip_types text/plain application/x-javascript application/javascript application/json text/css application/xml image/jpeg image/gif image/png; gzip_comp_level 6; gzip_disable "MSIE 6\."; proxy_cache_path /usr/local/nginx/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; include vhost/*.conf; }
upstream yyyyyyy.com { server 127.0.0.1:8081 weight=1; server 127.0.0.1:8082 weight=1; } server{ listen 443 ssl; server_name www.yyyyyyy.com yyyyyyy.com; ssl_certificate /usr/local/nginx/cert/yyyyyyy.com/2286250_yyyyyyy.com.pem; ssl_certificate_key /usr/local/nginx/cert/yyyyyyy.com/2286250_yyyyyyy.com.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!DH:!EXPORT:!RC4:+HIGH:+MEDIUM:!eNULL; ssl_prefer_server_ciphers on; proxy_buffering on; proxy_buffer_size 4k; proxy_buffers 8 4k; proxy_busy_buffers_size 16k; proxy_temp_path /usr/local/nginx/proxy_temp 1 2; proxy_max_temp_file_size 100M; proxy_temp_file_write_size 16k; location /{ root /usr/local/android/marketone; index index.html index.htm; error_page 500 502 503 504 /50x.html; proxy_cache my_zone; location = /50x.html { root html; } } location /api/upload/ { proxy_pass http://127.0.0.1:8081/estrendMarket/upload/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /api/ { proxy_pass http://xxxxxx.com/estrendMarket/; index index.html index.htm; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
讀到這里,這篇“nginx配置優(yōu)化實(shí)例分析”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。