運維支持

1.服務(wù)器磁盤空間滿,nginx日志清理

目錄:/var/autodelnginxlog.sh

可以調(diào)整腳本里面的天數(shù),比如將7天改成2天,然后運行腳本一次

2.鏈接映射:

120.55.54.219服務(wù)器找到路徑文件:

/etc/nginx/conf.d/xxxx.conf

參考樣例修改

location /v2/custom-product {

if ($query_string ~* ^(.*)activityCode=JP2020072318332365285&ch=KE_PUSH_XLY){

set $args '';

rewrite ^/v2/custom-product(.*)?https://host/course?courseCode=JP2019082211184552432&ch=KE_PUSH_XLY?permanent;

}

try_files $uri $uri/ /v2/index.html;

}

3. 偽靜態(tài)配置

# https://www.host.com/article-insure-JP2019101214274952259.html

# will rewrite to

# https://www.host.com/article.htmlpage=insure&articleCode=JP2019101214274952259.html

location / {

? ? ? ? ? ? proxy_set_header Host $host;

? ? ? ? ? ? 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 https;

? ? ? ? ? ? index index.html;

? ? ? ? ? ? rewrite ^/article-([^-]+)-([^-]+)-([^-]+)\.html$ /article.html break;

? ? ? ? ? ? #return 200 "[X] $request_uri -> $uri?$args";

? ? }

4.如何排查線上問題

方法一:error.log 通過報錯信息

2020-05-21?13:52:00,885?[49c5913e29e2] [http-nio-8072-exec-6]?ERROR com.xxx.cms.config.ExceptionAdvice.java:22?- Exception Advice?catch?error:

java.lang.NullPointerException:?null

如果已經(jīng)被壓縮到zip里面,使用 gzip -dc?/opt/logs/web/app.log | grep?49c5913e29e2

方法二:app.log 用戶嘗試再次觸發(fā)報錯

找到接口關(guān)鍵字 方法名、參數(shù)值等

tail -f /opt/logs/web-api/app.log | grep --line-buffer?1039006

2020-05-21?13:59:30,675?[f68bf59f2c7d] [http-nio-8074-exec-8] INFO?com.xxx.web.config.WebLogAspect.java:63?- WebLogAspect POST : http://host.com/api/course/v2/list,?ARGS : [{"courseType":"1039006","firstPurchase":false,"pageNum":1,"pageSize":10,"realSearch":false}]

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 《Docker環(huán)境下的前后端分離部署與運維》課程腳本 [TOC] 一、Docker虛擬機常用命令 先更新軟件包yu...
    mingminy閱讀 654評論 0 0
  • (第十九周作業(yè))1、運用haproxy實現(xiàn)nginx服務(wù)負載均衡需要三臺虛擬機做實驗:A機:安裝haproxy,實...
    haoxi2018閱讀 240評論 0 0
  • Nginx安裝 安裝 tar zxvf nginx-1.2.9.tar.gz#解壓nginxcdnginx-1.2...
    Java機械師閱讀 548評論 0 14
  • 主配置文件:/etc/nginx/nginx.conf user nginx; worker_processes ...
    天夭夭閱讀 285評論 0 0
  • 一. 準備 Python3 和 Python 虛擬環(huán)境 cd /opt yum -y install wget s...
    Jack0111閱讀 3,504評論 0 0

友情鏈接更多精彩內(nèi)容