首页 > 系统相关 >nginx的配置

nginx的配置

时间:2022-11-30 10:34:22浏览次数:41  
标签:index log 配置 server nginx html proxy timeout


#user nobody;
worker_processes 1;

error_log logs/error.log info;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


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 0;
keepalive_timeout 65;

#gzip on;


#负载配置
upstream myband {
server 127.0.0.1:9998;
server 127.0.0.1:9999;
}
#timeout 408
client_body_timeout 60m;
#client header timeout 408
client_header_timeout 60m;
#允许客户端请求的最大单个文件字节数
client_max_body_size 256m;
#缓冲区代理缓冲用户端请求的最大字节数,可以理解为先保存到本地再传给用户
client_body_buffer_size 1024m;
#
proxy_connect_timeout 3600;
#
proxy_read_timeout 3600;
#后端服务器数据回传时间
proxy_send_timeout 3600;
#
proxy_buffering on;
#
proxy_buffer_size 4m;
#
proxy_buffers 4 4m;
#
proxy_busy_buffers_size 8m;
#
fastcgi_read_timeout 3600;
#
server {
listen 8000;
server_name conversion;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root html;
index index.html index.htm;
}


location /converter/ {
proxy_pass http://myband/converter/;
}
#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}


# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}

标签:index,log,配置,server,nginx,html,proxy,timeout
From: https://www.cnblogs.com/heysong/p/16937666.html

相关文章

  • git提交日志中文配置
    gitbash已配置显示中文  但拉取时显示中文提交文件名为数字串 原因为在默认设置下,中文文件名在工作区状态输出,中文名不能正确显示,而是显示为八进制的字符编码。......
  • Spring Boot+Mybatis:实现数据库登录注册与两种properties配置参数读取
    〇、参考资料1、hutool介绍https://blog.csdn.net/abst122/article/details/1240913752、SpringBoot+Mybatis实现登录注册https://www.cnblogs.com/wiki918/p/1622175......
  • 一个有趣的nginx HTTP 400响应问题分析
    背景之前在一次不规范HTTP请求引发的nginx响应400问题分析与解决中写过客户端query参数未urlencode导致的400问题,当时的结论是:对于query参数带空格的请求,由于其不符合HT......
  • 练习_(if、case)多系统配置yum源
    #!/usr/bash/binyum_server=192.168.201.130os_version=`cat/etc/redhat-release|awk'{print$4}'|awk-F"."'{print$1"."$2}'`[-d/etc/yum.repos.d]||mk......
  • 感觉VS Code好难用啊,配置什么的好烦呀!!!
    为什么微软要把VSCode配置做的这么复杂,难道就没有简化方案吗?-知乎(zhihu.com) 因为VSCode不是(传统)IDE。你要把VSCode看做新时代的emacs,其IDE的部分的......
  • nginx 配置说明(逐渐完善。。。)
    http{#虚拟主机1server{listen80;#监听端口,基于IP配置的时候变更此处,比如192.168.1.100:8080;server_namewww.xdw.com;......
  • nginx启动失败
    nginx启动失败,查看日志报错:2022/11/2920:49:09[emerg]4344#12776:bind()to0.0.0.0:1188failed(10013:Anattemptwasmadetoaccessasocketinawayforbid......
  • 在VScode中配置 vue @路径提示
    1  2  3//导入文件时是否携带文件的扩展名"path-autocomplete.extensionOnlmport":true,//配置@的路径提示"path-autocomplete.pathMappings":{"@":"${......
  • flask,uwsgi,nginx部署配置
    初学flask部署,踩了一些坑记录一下。 uwsgi配置对于uwsgi的安装不详细描述在centos7上部署flask 大型应用的时候会使用工厂模式create_app(),放置在一个module的__init......
  • Oh My Zsh, 『 安装 & 配置 』
    OhMyZsh,『安装&配置』转至DreamOhMyZsh是什么OhMyZsh 是一款社区驱动的命令行工具,正如它的主页上说的,OhMyZsh 是一种生活方......