新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Nginx參數(shù)站點配置上的問題解決方案
Nginx參數(shù)有很多經(jīng)典的語句,其中upstream.conf 配置文件就是一個很好的例子,下面我們就看看如何才能好的使用這些語句呢?下面的文章就會對你有很好的幫助,尤其是在了解Nginx參數(shù)上的問題。

創(chuàng)新互聯(lián),專注為中小企業(yè)提供官網(wǎng)建設(shè)、營銷型網(wǎng)站制作、成都響應(yīng)式網(wǎng)站建設(shè)公司、展示型網(wǎng)站建設(shè)、成都網(wǎng)站制作等服務(wù),幫助中小企業(yè)通過網(wǎng)站體現(xiàn)價值、有效益。幫助企業(yè)快速建站、解決網(wǎng)站建設(shè)與網(wǎng)站營銷推廣問題。
- upstream.conf
- upstream bbs.linuxtone.com {
- server 192.168.1.4:8099;
- }
Nginx參數(shù)站點配置文件
- bbs.linuxtone.conf
- server
- {
- listen 80;
- server_name bbs.linuxtone.conf;
- charset GB2312;
- index index.html index.htm;
- root /date/wwwroot/linuxtone/;
- location ~ ^/NginxStatus/ {
- stub_status on;
- access_log off;
- }
- location / {
- root /date/wwwroot/linuxtone/;
- proxy_redirect off ;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 50m;
- client_body_buffer_size 256k;
- proxy_connect_timeout 30;
- proxy_send_timeout 30;
- proxy_read_timeout 60;
- proxy_buffer_size 256k;
- proxy_buffers 4 256k;
- proxy_busy_buffers_size 256k;
- proxy_temp_file_write_size 256k;
- proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
- proxy_max_temp_file_size 128m;
- proxy_pass http://bbs.linuxtone.com;
- }
Nginx參數(shù)都有所調(diào)整.目的是解決代理過程中出現(xiàn)的一些502 499錯誤
- #Add expires header for static content
- location ~* \.(jpg|jpeg|gif|png|swf)$ {
- if (-f $request_filename) {
- root /date/wwwroot/linuxtone/;
- expires 1d;
- break;
- }
- }
- log_format access '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" $http_x_forwarded_for';
- access_log /exp/Nginxlogs/bbs.linuxtone_access.log access;
- }
以上就是對Nginx參數(shù)的詳細(xì)介紹,希望大家有所幫助。
當(dāng)前題目:Nginx參數(shù)站點配置上的問題解決方案
文章分享:http://m.fisionsoft.com.cn/article/cdgsidi.html


咨詢
建站咨詢
