Python 官方文档:入门教程 => 点击学习
1.安装参考 # 解决 ./configure: error: C compiler cc is not found# 或者 make: *** No rule to make target `bui
# 解决 ./configure: error: C compiler cc is not found# 或者 make: *** No rule to make target `build', needed by `default'. Stop.# 或者 新机器安装Nginx,在make编译是报错:# 注意 需要删除原来configure的那个目录sudo yum install -y GCc gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel autoconf automake make gd gd-devel
# 参考文档:https://blog.csdn.net/biraotian/article/details/117084463./configure --prefix=/usr/local/nginx --with-Http_gzip_static_module
log_format log_JSON '{"time_local": "$time_iso8601", ' '"remote_addr": "$remote_addr", ' '"remote_user": "$remote_user", ' '"http_referer": "$http_referer", ' '"request": "$request", ' '"status": $status, ' '"body_bytes_sent": $body_bytes_sent, ' '"http_user_agent": "$http_user_agent", ' '"http_x_forwarded_for": "$http_x_forwarded_for", ' '"upstream_addr": "$upstream_addr",' '"upstream_connect_time": "$upstream_connect_time",' '"upstream_response_time": "$upstream_response_time",' '"upstream_header_time": "$upstream_header_time",' '"upstream_http_host": "$upstream_http_host",' '"request_time": "$request_time"' ' }';
注意:需要在http中引入该配置 ===> include /usr/local/nginx/conf/openapi.conf;
server { listen 9004; server_name localhost; location / { proxy_pass http://app_electronic_letter/; proxy_set_header Host $host:$server_port; proxy_set_header user-agent $http_user_agent; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 100m; client_body_buffer_size 1280k; proxy_connect_timeout 5s; proxy_send_timeout 900s; proxy_read_timeout 900s; proxy_buffering off; proxy_temp_file_write_size 640k; proxy_redirect off; } }upstream app_electronic_letter { server 172.17.9.13:9004 weight=1; server 172.17.9.14:9004 weight=1;}
# 查看nginx版本nginx -v# 检测nginx的配置文件nginx -t# 平滑重启:不会强制结束正在工作的连接,需要等所有连接都结束才会重启nginx -s reload# 指定配置文件启动,也可以不指定,使用默认的nginx.confnginx -c /etc/nginx/nginx.conf
来源地址:https://blog.csdn.net/zj20142213/article/details/133775447
--结束END--
本文标题: nginx安装和使用
本文链接: https://www.lsjlt.com/news/428811.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0