如何解决Nginx参数站点配置上的问题,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
Nginx参数有很多经典的语句,其中upstream.conf 配置文件就是一个很好的例子,下面我们就看看如何才能好的使用这些语句呢?下面的文章就会对你有很好的帮助,尤其是在了解Nginx参数上的问题。
upstream.conf upstream bbs.linuxtone.com { server 192.168.1.4:8099; }
Nginx参数站点配置文件
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参数都有所调整.目的是解决代理过程中出现的一些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参数站点配置上的问题问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。