• k8s nginx.conf配置文件配置


    • 无状态nginx配置
    • nginx.conf覆盖容器配置
      1. nginx.conf 代码:
      2. events {
      3. worker_connections 1024;
      4. }
      5. http {
      6. include /etc/nginx/mime.types;
      7. default_type application/octet-stream;
      8. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
      9. '$status $body_bytes_sent "$http_referer" '
      10. '"$http_user_agent" "$http_x_forwarded_for"';
      11. access_log /var/log/nginx/access.log;
      12. error_log /var/log/nginx/error.log;
      13. sendfile on;
      14. #tcp_nopush on;
      15. keepalive_timeout 65;
      16. #gzip on;
      17. include /etc/nginx/conf.d/*.conf;
      18. # C++网关
      19. server
      20. {
      21. listen 30001;
      22. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      23. add_header X-XSS-Protection "1; mode=block";
      24. add_header X-Frame-Options "SAMEORIGIN always";
      25. add_header X-Content-Type-Options "nosniff";
      26. # 转发websocket需要的设置
      27. proxy_set_header X-Real_IP $remote_addr;
      28. proxy_set_header Host $host;
      29. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      30. proxy_http_version 1.1;
      31. proxy_set_header Upgrade $http_upgrade;
      32. proxy_set_header Connection 'upgrade';
      33. location / {
      34. proxy_set_header Connection 'keep-alive';
      35. proxy_read_timeout 6000;
      36. proxy_pass http://gatewayserver.rz-dt:30001/;
      37. }
      38. location /weixin/ {
      39. proxy_pass http://ossaccessserver.rz-dt:30002/weixin/;
      40. }
      41. location /upload/ {
      42. client_max_body_size 1024M;
      43. client_body_buffer_size 1024M;
      44. proxy_pass http://fileserver.rz-dt:30001/upload/;
      45. }
      46. location /events/ {
      47. proxy_pass http://sseserver.rz-dt:30001/events/;
      48. }
      49. location /getEsignSignUrl/ {
      50. proxy_pass http://fileserver.rz-dt:30001/getEsignSignUrl/;
      51. }
      52. location /public/ {
      53. proxy_pass http://sseserver.rz-dt:30001/public/;
      54. }
      55. location /clean_download/ {
      56. proxy_pass http://fileserver.rz-dt:30001/clean_download/;
      57. }
      58. location /clean_download_data/ {
      59. proxy_pass http://fileserver.rz-dt:30001/clean_download_data/;
      60. }
      61. location /getOssSignUrl/ {
      62. client_max_body_size 1024M;
      63. client_body_buffer_size 1024M;
      64. proxy_pass http://fileserver.rz-dt:30001/getOssSignUrl/;
      65. }
      66. location /getStsToken/ {
      67. client_max_body_size 1024M;
      68. client_body_buffer_size 1024M;
      69. proxy_pass http://fileserver.rz-dt:30001/getStsToken/;
      70. }
      71. location /getPreviewUrl/ {
      72. client_max_body_size 1024M;
      73. client_body_buffer_size 1024M;
      74. proxy_pass http://fileserver.rz-dt:30001/getPreviewUrl/;
      75. }
      76. location /change_image_background_color/ {
      77. client_max_body_size 1024M;
      78. client_body_buffer_size 1024M;
      79. proxy_pass http://fileserver.rz-dt:30001/change_image_background_color/;
      80. }
      81. location /docx2pdf/ {
      82. client_max_body_size 50M;
      83. client_body_buffer_size 50M;
      84. proxy_pass http://fileserver.rz-dt:30001/docx2pdf/;
      85. }
      86. location /getPdfPageNum/ {
      87. proxy_pass http://fileserver.rz-dt:30001/getPdfPageNum/;
      88. }
      89. location /upload_esign/ {
      90. client_max_body_size 1024M;
      91. client_body_buffer_size 1024M;
      92. proxy_pass http://electronicpythonserver.rz-dt:30001/upload_esign;
      93. }
      94. location /elec_python/ {
      95. client_max_body_size 1024M;
      96. client_body_buffer_size 1024M;
      97. proxy_pass http://electronicpythonserver.rz-dt:30001/;
      98. }
      99. location /download/ {
      100. proxy_pass http://fileserver.rz-dt:30001/download/;
      101. }
      102. location /fdd_notify/ {
      103. proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
      104. }
      105. # location /hdwd_download/ {
      106. # client_max_body_size 1024M;
      107. # client_body_buffer_size 1024M;
      108. # proxy_pass http://investorrelationpythonserver.rz-dt:30001/download_interqa;
      109. # }
      110. # # 通讯录
      111. # location /address_book/ {
      112. # client_max_body_size 1024M;
      113. # client_body_buffer_size 1024M;
      114. # proxy_pass http://addressbookpythonserver.rz-dt:30001/;
      115. # }
      116. location /get_doc_info/ {
      117. client_max_body_size 1024M;
      118. client_body_buffer_size 1024M;
      119. proxy_pass http://espythonserver.rz-dt:30001/get_doc_info;
      120. }
      121. location /get_id_list/ {
      122. client_max_body_size 1024M;
      123. client_body_buffer_size 1024M;
      124. proxy_pass http://espythonserver.rz-dt:30001/get_id_list;
      125. }
      126. access_log /var/log/nginx/way.zhi.real.com.log;
      127. }
      128. # 智库web端v2
      129. server
      130. {
      131. listen 30002;
      132. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      133. #add_header Content-Security-Policy "default-src 'self' http://zhi.real.com; font-src 'self' data:; script-src unsafe-inline; script-src-elem unsafe-inline";
      134. add_header X-XSS-Protection "1; mode=block";
      135. add_header X-Frame-Options "SAMEORIGIN always";
      136. add_header X-Content-Type-Options "nosniff";
      137. # 转发websocket需要的设置
      138. proxy_set_header X-Real_IP $remote_addr;
      139. proxy_set_header Host $host;
      140. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      141. proxy_http_version 1.1;
      142. proxy_set_header Upgrade $http_upgrade;
      143. proxy_set_header Connection 'upgrade';
      144. location / {
      145. proxy_pass http://frontdongmi-official.rz-dt:30001/;
      146. }
      147. location /pdf_web/ {
      148. proxy_pass http://pdfwebserver.rz-dt:30001/pdf_web/;
      149. }
      150. location /weixinproxy/ {
      151. proxy_pass http://weixinproxyserver.rz-dt:30001/;
      152. }
      153. location /events/ {
      154. proxy_pass http://sseserver.rz-dt:30001/events/;
      155. }
      156. location /public/ {
      157. proxy_pass http://sseserver.rz-dt:30001/public/;
      158. }
      159. location /office_web/ {
      160. proxy_set_header X-Real_IP $remote_addr;
      161. proxy_set_header Host view.officeapps.live.com;
      162. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      163. proxy_http_version 1.1;
      164. proxy_set_header Upgrade $http_upgrade;
      165. proxy_set_header Connection 'upgrade';
      166. proxy_pass https://view.officeapps.live.com/;
      167. }
      168. location /weapp_esg/ {
      169. proxy_pass http://pdfwebserver.rz-dt:30001/weapp_esg/;
      170. }
      171. location /zhiku/ {
      172. proxy_pass http://frontdongmi.rz-dt:30001/zhiku/;
      173. #proxy_pass http://frontdongmi-mv-diag.rz-dt:30001/diag/;
      174. }
      175. location /im/ {
      176. proxy_pass http://frontdongmi-zhixin.rz-dt:30001/im/;
      177. }
      178. location /managePlatForm/ {
      179. proxy_pass http://frontdongmi-manager.rz-dt:30001/managePlatForm/;
      180. }
      181. location /cockpit/ {
      182. proxy_pass http://frontdongmi-cockpit.rz-dt:30001/cockpit/;
      183. }
      184. location /video/ {
      185. proxy_pass http://frontdongmi-video.rz-dt:30001/video/;
      186. }
      187. location /page/ {
      188. proxy_pass http://frontdongmi-page.rz-dt:30001/page/;
      189. }
      190. location /visualization/ {
      191. proxy_pass http://frontdongmi-visualization.rz-dt:30001/visualization/;
      192. }
      193. location /h5/ {
      194. proxy_pass http://frontdongmi-h5.rz-dt:30001/h5/;
      195. }
      196. location /diag/ {
      197. proxy_pass http://frontdongmi-mv-diag.rz-dt:30001/diag/;
      198. }
      199. location /h5_weApp/ {
      200. proxy_pass http://frontdongmi-h5-weapp.rz-dt:30001/h5_weApp/;
      201. }
      202. location /eSign/ {
      203. proxy_pass http://frontdongmi-esign.rz-dt:30001/eSign/;
      204. }
      205. location /esign-h5/ {
      206. proxy_pass http://frontdongmi-esign-h5.rz-dt:30001/esign-h5/;
      207. }
      208. location /m/ {
      209. proxy_pass http://frontdongmi-h5.rz-dt:30001/m/;
      210. }
      211. location /marketData/ {
      212. proxy_pass http://frontdongmi-marketdata.rz-dt:30001/marketData/;
      213. }
      214. location /weixin/ {
      215. proxy_pass http://ossaccessserver.rz-dt:30002/weixin/;
      216. }
      217. location /.well-known/ {
      218. proxy_pass http://ossaccessserver.rz-dt:30002/.well-known/;
      219. }
      220. location /getStsToken/ {
      221. client_max_body_size 1024M;
      222. client_body_buffer_size 1024M;
      223. proxy_pass http://fileserver.rz-dt:30001/getStsToken/;
      224. }
      225. location /rzgateway/ {
      226. client_max_body_size 1024M;
      227. client_body_buffer_size 1024M;
      228. #proxy_pass http://47.101.207.23:8082/;
      229. proxy_pass http://application-gateway.rz-dt:8080/;
      230. }
      231. location /rzwebgateway/ {
      232. add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
      233. add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
      234. if ($request_method = 'OPTIONS') {
      235. return 200;
      236. }
      237. client_max_body_size 1024M;
      238. client_body_buffer_size 1024M;
      239. proxy_pass http://realize-gateway.rz-dt:9300/;
      240. }
      241. location /gateway/ {
      242. proxy_set_header Connection 'keep-alive';
      243. proxy_pass http://gatewayserver.rz-dt:30001/;
      244. }
      245. location /upload/ {
      246. client_max_body_size 1024M;
      247. client_body_buffer_size 1024M;
      248. proxy_pass http://fileserver.rz-dt:30001/upload/;
      249. }
      250. location /getPreviewUrl/ {
      251. client_max_body_size 1024M;
      252. client_body_buffer_size 1024M;
      253. proxy_pass http://fileserver.rz-dt:30001/getPreviewUrl/;
      254. }
      255. location /upload_esign/ {
      256. client_max_body_size 1024M;
      257. client_body_buffer_size 1024M;
      258. proxy_pass http://electronicpythonserver.rz-dt:30001/upload_esign;
      259. }
      260. location /download/ {
      261. proxy_pass http://fileserver.rz-dt:30001/download/;
      262. }
      263. location /fdd_notify/ {
      264. proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
      265. }
      266. location /qiyu_notify/ {
      267. proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
      268. }
      269. access_log /var/log/nginx/zhi.real.com.log;
      270. }
      271. # 智库web端v1
      272. server
      273. {
      274. listen 30006;
      275. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      276. #add_header Content-Security-Policy "default-src 'self' http://zhi.real.com; font-src 'self' data:; script-src unsafe-inline; script-src-elem unsafe-inline";
      277. add_header X-XSS-Protection "1; mode=block";
      278. add_header X-Frame-Options "SAMEORIGIN always";
      279. add_header X-Content-Type-Options "nosniff";
      280. # 转发websocket需要的设置
      281. proxy_set_header X-Real_IP $remote_addr;
      282. proxy_set_header Host $host;
      283. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      284. proxy_http_version 1.1;
      285. proxy_set_header Upgrade $http_upgrade;
      286. proxy_set_header Connection 'upgrade';
      287. location / {
      288. proxy_pass http://frontdongmi-official-v1.rz-dt:30001/;
      289. }
      290. location /pdf_web/ {
      291. proxy_pass http://pdfwebserver.rz-dt:30001/pdf_web/;
      292. }
      293. location /weapp_esg/ {
      294. proxy_pass http://pdfwebserver.rz-dt:30001/weapp_esg/;
      295. }
      296. location /zhiku/ {
      297. proxy_pass http://frontdongmi-v1.rz-dt:30001/zhiku/;
      298. }
      299. location /managePlatForm/ {
      300. proxy_pass http://frontdongmi-manager.rz-dt:30001/managePlatForm/;
      301. }
      302. location /video/ {
      303. proxy_pass http://frontdongmi-video.rz-dt:30001/video/;
      304. }
      305. location /page/ {
      306. proxy_pass http://frontdongmi-page.rz-dt:30001/page/;
      307. }
      308. location /visualization/ {
      309. proxy_pass http://frontdongmi-visualization.rz-dt:30001/visualization/;
      310. }
      311. location /h5/ {
      312. proxy_pass http://frontdongmi-h5.rz-dt:30001/h5/;
      313. }
      314. location /h5_weApp/ {
      315. proxy_pass http://frontdongmi-h5-weapp.rz-dt:30001/h5_weApp/;
      316. }
      317. location /m/ {
      318. proxy_pass http://frontdongmi-h5.rz-dt:30001/m/;
      319. }
      320. location /marketData/ {
      321. proxy_pass http://frontdongmi-marketdata.rz-dt:30001/marketData/;
      322. }
      323. location /weixin/ {
      324. proxy_pass http://ossaccessserver.rz-dt:30002/weixin/;
      325. }
      326. location /.well-known/ {
      327. proxy_pass http://ossaccessserver.rz-dt:30002/.well-known/;
      328. }
      329. location /getStsToken/ {
      330. client_max_body_size 1024M;
      331. client_body_buffer_size 1024M;
      332. proxy_pass http://fileserver.rz-dt:30001/getStsToken/;
      333. }
      334. location /rzgateway/ {
      335. client_max_body_size 1024M;
      336. client_body_buffer_size 1024M;
      337. #proxy_pass http://47.101.207.23:8082/;
      338. #proxy_pass http://139.224.134.101:8082/;
      339. proxy_pass http://application-gateway.rz-dt:8080/;
      340. }
      341. location /rzwebgateway/ {
      342. add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
      343. add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
      344. if ($request_method = 'OPTIONS') {
      345. return 200;
      346. }
      347. client_max_body_size 1024M;
      348. client_body_buffer_size 1024M;
      349. proxy_pass http://realize-gateway.rz-dt:9300/;
      350. }
      351. location /gateway/ {
      352. proxy_set_header Connection 'keep-alive';
      353. proxy_pass http://gatewayserver.rz-dt:30001/;
      354. }
      355. location /upload/ {
      356. client_max_body_size 1024M;
      357. client_body_buffer_size 1024M;
      358. proxy_pass http://fileserver.rz-dt:30001/upload/;
      359. }
      360. location /getPreviewUrl/ {
      361. client_max_body_size 1024M;
      362. client_body_buffer_size 1024M;
      363. proxy_pass http://fileserver.rz-dt:30001/getPreviewUrl/;
      364. }
      365. location /upload_esign/ {
      366. client_max_body_size 1024M;
      367. client_body_buffer_size 1024M;
      368. proxy_pass http://electronicpythonserver.rz-dt:30001/upload_esign;
      369. }
      370. location /download/ {
      371. proxy_pass http://fileserver.rz-dt:30001/download/;
      372. }
      373. location /fdd_notify/ {
      374. proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
      375. }
      376. access_log /var/log/nginx/zhiku-v1.zhi.real.com.log;
      377. }
      378. # 荣正网关
      379. server
      380. {
      381. listen 30003;
      382. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      383. # 转发websocket需要的设置
      384. proxy_set_header X-Real_IP $remote_addr;
      385. proxy_set_header Host $host;
      386. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      387. proxy_http_version 1.1;
      388. proxy_set_header Upgrade $http_upgrade;
      389. proxy_set_header Connection 'upgrade';
      390. location / {
      391. client_max_body_size 1024M;
      392. client_body_buffer_size 1024M;
      393. proxy_pass http://realize-auth.rz-dt:9301/;
      394. }
      395. access_log /var/log/nginx/rzgateway.zhi.real.com.log;
      396. }
      397. # 采集平台
      398. server
      399. {
      400. listen 30004;
      401. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      402. # 转发websocket需要的设置
      403. proxy_set_header X-Real_IP $remote_addr;
      404. proxy_set_header Host $host;
      405. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      406. proxy_http_version 1.1;
      407. proxy_set_header Upgrade $http_upgrade;
      408. proxy_set_header Connection 'upgrade';
      409. location / {
      410. proxy_pass http://spiderflow.rz-dt:30001/;
      411. }
      412. access_log /var/log/nginx/spider.zhi.real.com.log;
      413. }
      414. # 视频营销
      415. server
      416. {
      417. listen 30005;
      418. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      419. # 转发websocket需要的设置
      420. proxy_set_header X-Real_IP $remote_addr;
      421. proxy_set_header Host idtcdn.oss-cn-hangzhou.aliyuncs.com;
      422. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      423. proxy_http_version 1.1;
      424. proxy_set_header Upgrade $http_upgrade;
      425. proxy_set_header Connection 'upgrade';
      426. location / {
      427. proxy_pass http://idtcdn.oss-cn-hangzhou.aliyuncs.com/;
      428. }
      429. access_log /var/log/nginx/video.zhi.real.com.log;
      430. }
      431. # 文件服务
      432. server
      433. {
      434. listen 30007;
      435. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
      436. proxy_set_header X-Real_IP $remote_addr;
      437. proxy_set_header Host $host;
      438. proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
      439. proxy_http_version 1.1;
      440. proxy_set_header Upgrade $http_upgrade;
      441. proxy_set_header Connection 'upgrade';
      442. location / {
      443. client_max_body_size 50M;
      444. client_body_buffer_size 50M;
      445. proxy_pass http://fileserver.rz-dt:30001/;
      446. }
      447. access_log /var/log/nginx/file.zhi.real.com.log;
      448. }
      449. }

  • 相关阅读:
    Stable Diffusion之novel Ai教程,小白必经之路
    B站:TED-ED 世界人文历史英文动画100集【双语字幕】(第1集)
    【数据结构】二叉搜索树,AVL树,2-3树,红黑树、B树B+树简单笔记
    typeof的作用
    DNS域名解析服务
    Python搭配GBase 8s
    网络安全里主要的岗位有哪些?小白如何快速入门学习黑客?
    JUC-同步
    计算机毕业设计Javaweb唐院寻人表白系统(源码+系统+mysql数据库+lw文档)
    vue中实现百度地图全国与省市地图切换
  • 原文地址:https://blog.csdn.net/xiaogg3678/article/details/139630691