nginx 常用问题记录

反向代理

        location /qa_apis/ {
            proxy_pass http://127.0.0.1:9011/;
            proxy_set_header Host $host:$server_port;
        }

注意空格和tab,注意proxy_pass结尾的/

docker内的nginx,注意nginx的监听端口是容器内的,转发的ip尽量不用localhost和127.0.0.1

后续更新

正向代理

负载均衡

tcp端口转发

stream {
    server {
        ## ipv6监听80端口 listen [::1]:80;
        listen 88;
        proxy_pass 192.168.6.11:9200;
    }
}

vue路由问题

server
{
    listen 80;
    server_name testwx.wangshibo.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/ssoShuang/dist;
 
    #vue-router配置
    location / {
        try_files $uri $uri/ @router;
        index index.html;
    }
    location @router {
        rewrite ^.*$ /index.html last;
    }
}

大数据量问题

参数优化,上传413异常

client_max_body_size     50m; 
client_header_timeout    1m;
client_body_timeout      1m;
proxy_connect_timeout     60s;
proxy_read_timeout      1m;
proxy_send_timeout      1m;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,可以得出关于nginx的攻击记录有以下几种情况: 1. 使用$http_user_agent变量进行攻击:在nginx配置文件中,通过判断请求头中的User-Agent字段是否包含特定的字符串,如"must-revalidate",如果包含则返回403禁止访问。这种攻击记录可以通过检查日志中的$http_user_agent字段来发现\[1\]。 2. 使用deny指令屏蔽特定IP地址进行攻击:在nginx配置文件中,通过deny指令将特定的IP地址屏蔽,从而阻止其访问。这种攻击记录可以通过检查日志中的IP地址和deny指令的配置来发现\[2\]。 3. 通过篡改请求头中的IP地址进行攻击:攻击者可以通过修改请求头中的IP地址字段来规避IP限制。在实际应用中,对于IP的限制需要明确自己的需求场景,并知道如何正确获取IP地址进行限制。这种攻击记录可以通过检查日志中的remote_addr和http_x_forwarded_for字段来发现\[3\]。 综上所述,nginx的攻击记录包括使用特定User-Agent字段进行攻击、屏蔽特定IP地址进行攻击以及通过篡改请求头中的IP地址进行攻击。 #### 引用[.reference_title] - *1* *2* [nginx预防常见攻击](https://blog.csdn.net/yueaini10000/article/details/103426202)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Nginx一次肉鸡攻击记录](https://blog.csdn.net/weixin_43950985/article/details/103930185)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值