proginn.nginx.conf 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. # 技术圈
  2. server {
  3. listen 80;
  4. server_name {{domain}}.test-jishuin.proginn.com;
  5. root /code/web/phphub/public;
  6. index index.php;
  7. rewrite ^/user/(\d+)$ /u/$1 permanent;
  8. rewrite ^/user/collect_article/(\d+)$ /jishuin/c/$1 permanent;
  9. rewrite ^/c/([a-z0-9]+)$ /jishuin/c/$1 last;
  10. location / {
  11. if (!-e $request_filename) {
  12. rewrite ^(.*)$ /index.php?s=$1 last;
  13. break;
  14. }
  15. }
  16. set $temp_request_id $http_x_request_id;
  17. if ($temp_request_id = "") {
  18. set $temp_request_id $request_id;
  19. }
  20. location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
  21. deny all;
  22. }
  23. location ^~ /user/ {
  24. proxy_pass http://127.0.0.1:3000;
  25. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  26. }
  27. location ^~ /user/quit {
  28. proxy_pass http://127.0.0.1;
  29. proxy_set_header Host {{domain}}.test.proginn.com;
  30. }
  31. location ^~ /topics/create {
  32. proxy_pass http://127.0.0.1:3000;
  33. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  34. }
  35. location ~ /topics/\d+/edit {
  36. proxy_pass http://127.0.0.1:3000;
  37. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  38. }
  39. location ^~ /file/proxyUpload {
  40. proxy_pass http://127.0.0.1;
  41. proxy_set_header Host {{domain}}.test.proginn.com;
  42. }
  43. location /ajax/getmessage {
  44. proxy_pass http://127.0.0.1;
  45. proxy_set_header Host {{domain}}.test.proginn.com;
  46. }
  47. location /api {
  48. proxy_pass http://127.0.0.1;
  49. proxy_set_header Host {{domain}}.test.proginn.com;
  50. }
  51. location ^~ /.nuxt {
  52. proxy_pass http://127.0.0.1:3000;
  53. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  54. }
  55. location ^~ /_nuxt {
  56. proxy_pass http://127.0.0.1:3000;
  57. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  58. }
  59. location ^~ /uapi {
  60. proxy_pass http://127.0.0.1:5000;
  61. proxy_set_header Host {{domain}}.test.proginn.com;
  62. }
  63. location ^~ /wapi {
  64. proxy_pass http://127.0.0.1:5000;
  65. proxy_set_header Host {{domain}}.test.proginn.com;
  66. }
  67. location ^~ /sapi {
  68. proxy_pass http://127.0.0.1:5000;
  69. proxy_set_header Host {{domain}}.test.proginn.com;
  70. }
  71. location ~ \.php$ {
  72. fastcgi_pass unix:/var/run/php7-fpm.sock;
  73. fastcgi_index index.php;
  74. include fastcgi_params;
  75. fastcgi_param SCRIPT_FILENAME $request_filename;
  76. }
  77. access_log /data/log/jishuin.log proginn-logid;
  78. }
  79. # 解决方案
  80. server {
  81. listen 80;
  82. server_name {{domain}}.test-kaifain.proginn.com;
  83. set $temp_request_id $http_x_request_id;
  84. if ($temp_request_id = "") {
  85. set $temp_request_id $request_id;
  86. }
  87. location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
  88. deny all;
  89. }
  90. location /api/v {
  91. proxy_pass http://10.200.0.1:8811;
  92. proxy_set_header Host $http_host;
  93. }
  94. location /_api {
  95. proxy_pass http://10.200.0.1:8812;
  96. proxy_set_header Host $http_host;
  97. }
  98. location /crpc {
  99. proxy_pass http://10.200.0.1:8800;
  100. proxy_set_header Host $http_host;
  101. }
  102. location /prpc {
  103. proxy_pass http://10.200.0.1:8003;
  104. proxy_set_header Host $http_host;
  105. }
  106. location / {
  107. proxy_pass http://127.0.0.1:8810;
  108. proxy_set_header Host {{domain}}.test-kaifain.proginn.com;
  109. }
  110. access_log /data/log/kafain.log proginn-logid;
  111. }
  112. # 兼职招聘
  113. server {
  114. listen 80;
  115. server_name {{domain}}.test-job.proginn.com;
  116. root /proginn-frontend/dist/;
  117. index index.html;
  118. rewrite ^/d/([a-z0-9]+)$ /job/detail/$1 last;
  119. location / {
  120. if (!-e $request_filename) {
  121. rewrite ^(.*)$ /job$1 last;
  122. break;
  123. }
  124. }
  125. set $temp_request_id $http_x_request_id;
  126. if ($temp_request_id = "") {
  127. set $temp_request_id $request_id;
  128. }
  129. location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) {
  130. deny all;
  131. }
  132. location ^~ /job {
  133. proxy_pass http://127.0.0.1:3000;
  134. proxy_set_header Host {{domain}}.test-job.proginn.com;
  135. }
  136. location ^~ /user/quit {
  137. proxy_pass http://127.0.0.1;
  138. proxy_set_header Host {{domain}}.test.proginn.com;
  139. }
  140. location ^~ /file/proxyUpload {
  141. proxy_pass http://127.0.0.1;
  142. proxy_set_header Host {{domain}}.test.proginn.com;
  143. }
  144. location /ajax/getmessage {
  145. proxy_pass http://127.0.0.1;
  146. proxy_set_header Host {{domain}}.test.proginn.com;
  147. }
  148. location /api {
  149. proxy_pass http://127.0.0.1;
  150. proxy_set_header Host {{domain}}.test.proginn.com;
  151. }
  152. location ^~ /.nuxt {
  153. proxy_pass http://127.0.0.1:3000;
  154. proxy_set_header Host {{domain}}.test-job.proginn.com;
  155. }
  156. location ^~ /_nuxt {
  157. proxy_pass http://127.0.0.1:3000;
  158. proxy_set_header Host {{domain}}.test-job.proginn.com;
  159. }
  160. access_log /data/log/job.log proginn-logid;
  161. }
  162. # proginn
  163. server {
  164. listen 80;
  165. server_name {{domain}}.test.proginn.com;
  166. root /code/web/;
  167. index index.php index.html index.htm;
  168. rewrite ^/job/(.*)$ https://{{domain}}.test-job.proginn.com/$1 permanent;
  169. # rewrite ^/kaifain/(?!(add|preview))$ http://{{domain}}.test-kaifain.proginn.com/$1 permanent;
  170. location ^~ /uapi {
  171. proxy_pass http://127.0.0.1:5000;
  172. proxy_set_header Host {{domain}}.test.proginn.com;
  173. }
  174. location ^~ /wapi {
  175. proxy_pass http://127.0.0.1:5000;
  176. proxy_set_header Host {{domain}}.test.proginn.com;
  177. }
  178. location ^~ /sapi {
  179. proxy_pass http://127.0.0.1:5000;
  180. proxy_set_header Host {{domain}}.test.proginn.com;
  181. }
  182. location ~ ^/type/service$ {
  183. proxy_pass http://127.0.0.1:3000;
  184. proxy_set_header Host $host;
  185. proxy_set_header X-Request-Id $temp_request_id;
  186. }
  187. location ~ ^/company$ {
  188. proxy_pass http://127.0.0.1:3000;
  189. proxy_set_header Host $host;
  190. proxy_set_header X-Request-Id $temp_request_id;
  191. }
  192. location ^~ /l/ {
  193. proxy_pass http://127.0.0.1:3000;
  194. proxy_set_header Host $host;
  195. proxy_set_header X-Request-Id $temp_request_id;
  196. }
  197. location ^~ /skill {
  198. proxy_pass http://127.0.0.1:3000;
  199. proxy_set_header Host {{domain}}.test.proginn.com;
  200. }
  201. location ^~ /s/ {
  202. proxy_pass http://127.0.0.1:3000;
  203. proxy_set_header Host {{domain}}.test.proginn.com;
  204. }
  205. location ^~ /consult {
  206. proxy_pass http://127.0.0.1:3000;
  207. proxy_set_header Host {{domain}}.test.proginn.com;
  208. }
  209. location ^~ /c/ {
  210. proxy_pass http://127.0.0.1:3000;
  211. proxy_set_header Host {{domain}}.test.proginn.com;
  212. }
  213. location / {
  214. if (!-e $request_filename) {
  215. rewrite ^(.*)$ /index.php?s=$1 last;
  216. break;
  217. }
  218. }
  219. set $temp_request_id $http_x_request_id;
  220. if ($temp_request_id = "") {
  221. set $temp_request_id $request_id;
  222. }
  223. location /community {
  224. rewrite ^/community(.*)$ https://{{domain}}.test-jishuin.proginn.com$1 permanent;
  225. }
  226. location /festival {
  227. alias /festival/dist;
  228. index index.html index.htm;
  229. if (!-e $request_filename) {
  230. rewrite ^(.*)$ /festival/index.html last;
  231. break;
  232. }
  233. }
  234. location /oauth2 {
  235. alias /code/web/openx/public/oauth2;
  236. index index.php;
  237. if (!-e $request_filename) {
  238. rewrite ^(.*)$ /oauth2/index.php last;
  239. break;
  240. }
  241. location ~ \.php$ {
  242. fastcgi_pass unix:/var/run/php7-fpm.sock;
  243. fastcgi_index index.php;
  244. include fastcgi_params;
  245. fastcgi_param SCRIPT_FILENAME $request_filename;
  246. }
  247. }
  248. location /openapi {
  249. alias /code/web/openx/public/api;
  250. index index.php;
  251. if (!-e $request_filename) {
  252. rewrite ^(.*)$ /openapi/index.php last;
  253. break;
  254. }
  255. location ~ \.php$ {
  256. fastcgi_pass unix:/var/run/php7-fpm.sock;
  257. fastcgi_index index.php;
  258. include fastcgi_params;
  259. fastcgi_param SCRIPT_FILENAME $request_filename;
  260. }
  261. }
  262. location ~ \.php$ {
  263. fastcgi_pass unix:/var/run/php7-fpm.sock;
  264. fastcgi_index index.php;
  265. include fastcgi_params;
  266. }
  267. location ^~ /type/vip {
  268. proxy_pass http://127.0.0.1:3000;
  269. proxy_set_header Host {{domain}}.test.proginn.com;
  270. }
  271. location ^~ /cert {
  272. proxy_pass http://127.0.0.1:3000;
  273. proxy_set_header Host {{domain}}.test.proginn.com;
  274. }
  275. location ^~ /group {
  276. proxy_pass http://127.0.0.1:3000;
  277. proxy_set_header Host {{domain}}.test.proginn.com;
  278. }
  279. location ^~ /kaifain/add {
  280. proxy_pass http://127.0.0.1:3000;
  281. proxy_set_header Host {{domain}}.test.proginn.com;
  282. }
  283. location ^~ /kaifain/preview {
  284. proxy_pass http://127.0.0.1:3000;
  285. proxy_set_header Host {{domain}}.test.proginn.com;
  286. }
  287. location ^~ /setting/check/old_mobile {
  288. proxy_pass http://127.0.0.1:3000;
  289. proxy_set_header Host {{domain}}.test.proginn.com;
  290. }
  291. location ^~ /setting/check/real_info {
  292. proxy_pass http://127.0.0.1:3000;
  293. proxy_set_header Host {{domain}}.test.proginn.com;
  294. }
  295. location ^~ /setting/check/change_mobile {
  296. proxy_pass http://127.0.0.1:3000;
  297. proxy_set_header Host {{domain}}.test.proginn.com;
  298. }
  299. location ^~ /user/register {
  300. proxy_pass http://127.0.0.1:3000;
  301. proxy_set_header Host {{domain}}.test.proginn.com;
  302. }
  303. location ^~ /.nuxt {
  304. proxy_pass http://127.0.0.1:3000;
  305. proxy_set_header Host {{domain}}.test.proginn.com;
  306. }
  307. location ^~ /_nuxt {
  308. proxy_pass http://127.0.0.1:3000;
  309. proxy_set_header Host {{domain}}.test.proginn.com;
  310. }
  311. location ^~ /wo/cash {
  312. proxy_pass http://127.0.0.1:3000;
  313. proxy_set_header Host {{domain}}.test.proginn.com;
  314. }
  315. location ^~ /sign/new {
  316. proxy_pass http://127.0.0.1:3000;
  317. proxy_set_header Host {{domain}}.test.proginn.com;
  318. }
  319. location ^~ /type/interview {
  320. proxy_pass http://127.0.0.1:3000;
  321. proxy_set_header Host {{domain}}.test.proginn.com;
  322. }
  323. location ^~ /type/partners/ {
  324. proxy_pass http://127.0.0.1:3000;
  325. proxy_set_header Host {{domain}}.test.proginn.com;
  326. }
  327. location ^~ /wo/bills {
  328. proxy_pass http://127.0.0.1:3000;
  329. proxy_set_header Host {{domain}}.test.proginn.com;
  330. }
  331. location ^~ /recruit/ {
  332. proxy_pass http://127.0.0.1:3000;
  333. proxy_set_header Host {{domain}}.test.proginn.com;
  334. }
  335. location ^~ /salary/ {
  336. proxy_pass http://127.0.0.1:3000;
  337. proxy_set_header Host {{domain}}.test.proginn.com;
  338. }
  339. location ^~ /salary/detail {
  340. proxy_pass http://127.0.0.1:3000;
  341. proxy_set_header Host {{domain}}.test.proginn.com;
  342. }
  343. location ^~ /credit {
  344. proxy_pass http://127.0.0.1:3000;
  345. proxy_set_header Host {{domain}}.test.proginn.com;
  346. }
  347. location ^~ /work_down {
  348. proxy_pass http://127.0.0.1:3000;
  349. proxy_set_header Host {{domain}}.test.proginn.com;
  350. }
  351. location ^~ /frontend/ {
  352. proxy_pass http://127.0.0.1:3000;
  353. proxy_set_header Host {{domain}}.test.proginn.com;
  354. }
  355. location ^~ /ccf/ {
  356. proxy_pass http://127.0.0.1:3000;
  357. proxy_set_header Host {{domain}}.test.proginn.com;
  358. }
  359. location ^~ /otherpage {
  360. proxy_pass http://127.0.0.1:3000;
  361. proxy_set_header Host {{domain}}.test.proginn.com;
  362. }
  363. location ^~ /upload_image {
  364. proxy_pass http://127.0.0.1;
  365. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  366. }
  367. location ^~ /Public/ {
  368. # 匹配任何以 /Public/ 开头的地址,匹配符合以后,停止往下搜索正则,采用这一条。
  369. expires 1d;
  370. access_log off;
  371. }
  372. access_log /data/log/access.log proginn-logid;
  373. }
  374. # 新后台
  375. server {
  376. listen 80;
  377. server_name {{domain}}.test-rooter.proginn.com;
  378. root /boss/dist;
  379. index index.html index.htm;
  380. location / {
  381. if (!-e $request_filename) {
  382. rewrite ^(.*)$ /index.html last;
  383. break;
  384. }
  385. }
  386. set $temp_request_id $http_x_request_id;
  387. if ($temp_request_id = "") {
  388. set $temp_request_id $request_id;
  389. }
  390. location /api {
  391. proxy_pass http://127.0.0.1;
  392. proxy_set_header Host {{domain}}.test.proginn.com;
  393. }
  394. location ^~ /upload_image {
  395. proxy_pass http://127.0.0.1;
  396. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  397. }
  398. location ^~ /uapi {
  399. proxy_pass http://127.0.0.1:5000;
  400. proxy_set_header Host {{domain}}.test.proginn.com;
  401. }
  402. location ^~ /wapi {
  403. proxy_pass http://127.0.0.1:5000;
  404. proxy_set_header Host {{domain}}.test.proginn.com;
  405. }
  406. location ^~ /sapi {
  407. proxy_pass http://127.0.0.1:5000;
  408. proxy_set_header Host {{domain}}.test.proginn.com;
  409. }
  410. access_log /data/log/boss.log proginn-logid;
  411. }
  412. # festival
  413. server {
  414. listen 80;
  415. server_name {{domain}}.test-festival.proginn.com;
  416. root /boss/dist;
  417. index index.html index.htm;
  418. location / {
  419. if (!-e $request_filename) {
  420. rewrite ^(.*)$ /index.html last;
  421. break;
  422. }
  423. }
  424. location /api {
  425. proxy_pass http://127.0.0.1;
  426. proxy_set_header Host {{domain}}.test.proginn.com;
  427. }
  428. location ^~ /upload_image {
  429. proxy_pass http://127.0.0.1;
  430. proxy_set_header Host {{domain}}.test.proginn.com;
  431. }
  432. access_log /data/log/festival.log proginn-logid;
  433. }
  434. # 用户模块
  435. server {
  436. listen 5000;
  437. server_name {{domain}}.test.proginn.com;
  438. root /proginn-user/public/;
  439. index index.php index.html index.htm;
  440. location / {
  441. if (!-e $request_filename) {
  442. rewrite ^(.*)$ /index.php?s=$1 last;
  443. break;
  444. }
  445. }
  446. set $temp_request_id $http_x_request_id;
  447. if ($temp_request_id = "") {
  448. set $temp_request_id $request_id;
  449. }
  450. location ~ \.php$ {
  451. fastcgi_pass unix:/var/run/php7-fpm.sock;
  452. fastcgi_index index.php;
  453. include fastcgi_params;
  454. }
  455. access_log /data/log/user_proginn_access.log proginn-logid;
  456. }
  457. # bituni
  458. server {
  459. listen 80;
  460. server_name {{domain}}.test-bituni.proginn.com;
  461. root /proginn-bituni/public/;
  462. index index.php index.html index.htm;
  463. location / {
  464. if (!-e $request_filename) {
  465. rewrite ^(.*)$ /index.php?s=$1 last;
  466. break;
  467. }
  468. }
  469. set $temp_request_id $http_x_request_id;
  470. if ($temp_request_id = "") {
  471. set $temp_request_id $request_id;
  472. }
  473. location ~ \.php$ {
  474. fastcgi_pass unix:/var/run/php7-fpm.sock;
  475. fastcgi_index index.php;
  476. include fastcgi_params;
  477. }
  478. location ^~ /qd {
  479. proxy_pass http://127.0.0.1:3001;
  480. proxy_set_header Host {{domain}}.test.proginn.com;
  481. }
  482. location ^~ /_next {
  483. proxy_pass http://127.0.0.1:3001;
  484. proxy_set_header Host {{domain}}.test.proginn.com;
  485. }
  486. access_log /data/log/user_proginn_access.log proginn-logid;
  487. }