proginn.nginx.conf 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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 ^~ /u/ {
  171. proxy_pass http://127.0.0.1:3000;
  172. proxy_set_header Host {{domain}}.test.proginn.com;
  173. }
  174. location ^~ /uapi {
  175. proxy_pass http://127.0.0.1:5000;
  176. proxy_set_header Host {{domain}}.test.proginn.com;
  177. }
  178. location ^~ /wapi {
  179. proxy_pass http://127.0.0.1:5000;
  180. proxy_set_header Host {{domain}}.test.proginn.com;
  181. }
  182. location ^~ /sapi {
  183. proxy_pass http://127.0.0.1:5000;
  184. proxy_set_header Host {{domain}}.test.proginn.com;
  185. }
  186. location ~ ^/type/service$ {
  187. proxy_pass http://127.0.0.1:3000;
  188. proxy_set_header Host $host;
  189. proxy_set_header X-Request-Id $temp_request_id;
  190. }
  191. location ~ ^/company$ {
  192. proxy_pass http://127.0.0.1:3000;
  193. proxy_set_header Host $host;
  194. proxy_set_header X-Request-Id $temp_request_id;
  195. }
  196. location ^~ /l/ {
  197. proxy_pass http://127.0.0.1:3000;
  198. proxy_set_header Host $host;
  199. proxy_set_header X-Request-Id $temp_request_id;
  200. }
  201. location ^~ /skill {
  202. proxy_pass http://127.0.0.1:3000;
  203. proxy_set_header Host {{domain}}.test.proginn.com;
  204. }
  205. location ^~ /works {
  206. proxy_pass http://127.0.0.1:3000;
  207. proxy_set_header Host {{domain}}.test.proginn.com;
  208. }
  209. location ^~ /s/ {
  210. proxy_pass http://127.0.0.1:3000;
  211. proxy_set_header Host {{domain}}.test.proginn.com;
  212. }
  213. location ^~ /consult {
  214. proxy_pass http://127.0.0.1:3000;
  215. proxy_set_header Host {{domain}}.test.proginn.com;
  216. }
  217. location ^~ /c/ {
  218. proxy_pass http://127.0.0.1:3000;
  219. proxy_set_header Host {{domain}}.test.proginn.com;
  220. }
  221. location / {
  222. if (!-e $request_filename) {
  223. rewrite ^(.*)$ /index.php?s=$1 last;
  224. break;
  225. }
  226. }
  227. set $temp_request_id $http_x_request_id;
  228. if ($temp_request_id = "") {
  229. set $temp_request_id $request_id;
  230. }
  231. location /community {
  232. rewrite ^/community(.*)$ https://{{domain}}.test-jishuin.proginn.com$1 permanent;
  233. }
  234. location /festival {
  235. alias /festival/dist;
  236. index index.html index.htm;
  237. if (!-e $request_filename) {
  238. rewrite ^(.*)$ /festival/index.html last;
  239. break;
  240. }
  241. }
  242. location /oauth2 {
  243. alias /code/web/openx/public/oauth2;
  244. index index.php;
  245. if (!-e $request_filename) {
  246. rewrite ^(.*)$ /oauth2/index.php last;
  247. break;
  248. }
  249. location ~ \.php$ {
  250. fastcgi_pass unix:/var/run/php7-fpm.sock;
  251. fastcgi_index index.php;
  252. include fastcgi_params;
  253. fastcgi_param SCRIPT_FILENAME $request_filename;
  254. }
  255. }
  256. location /openapi {
  257. alias /code/web/openx/public/api;
  258. index index.php;
  259. if (!-e $request_filename) {
  260. rewrite ^(.*)$ /openapi/index.php last;
  261. break;
  262. }
  263. location ~ \.php$ {
  264. fastcgi_pass unix:/var/run/php7-fpm.sock;
  265. fastcgi_index index.php;
  266. include fastcgi_params;
  267. fastcgi_param SCRIPT_FILENAME $request_filename;
  268. }
  269. }
  270. location ~ \.php$ {
  271. fastcgi_pass unix:/var/run/php7-fpm.sock;
  272. fastcgi_index index.php;
  273. include fastcgi_params;
  274. }
  275. location ^~ /type/vip {
  276. proxy_pass http://127.0.0.1:3000;
  277. proxy_set_header Host {{domain}}.test.proginn.com;
  278. }
  279. location ^~ /cert {
  280. proxy_pass http://127.0.0.1:3000;
  281. proxy_set_header Host {{domain}}.test.proginn.com;
  282. }
  283. location ^~ /group {
  284. proxy_pass http://127.0.0.1:3000;
  285. proxy_set_header Host {{domain}}.test.proginn.com;
  286. }
  287. location ^~ /kaifain/add {
  288. proxy_pass http://127.0.0.1:3000;
  289. proxy_set_header Host {{domain}}.test.proginn.com;
  290. }
  291. location ^~ /kaifain/preview {
  292. proxy_pass http://127.0.0.1:3000;
  293. proxy_set_header Host {{domain}}.test.proginn.com;
  294. }
  295. location ^~ /setting/check/old_mobile {
  296. proxy_pass http://127.0.0.1:3000;
  297. proxy_set_header Host {{domain}}.test.proginn.com;
  298. }
  299. location ^~ /setting/check/real_info {
  300. proxy_pass http://127.0.0.1:3000;
  301. proxy_set_header Host {{domain}}.test.proginn.com;
  302. }
  303. location ^~ /setting/check/change_mobile {
  304. proxy_pass http://127.0.0.1:3000;
  305. proxy_set_header Host {{domain}}.test.proginn.com;
  306. }
  307. location ^~ /user/register {
  308. proxy_pass http://127.0.0.1:3000;
  309. proxy_set_header Host {{domain}}.test.proginn.com;
  310. }
  311. location ^~ /.nuxt {
  312. proxy_pass http://127.0.0.1:3000;
  313. proxy_set_header Host {{domain}}.test.proginn.com;
  314. }
  315. location ^~ /_nuxt {
  316. proxy_pass http://127.0.0.1:3000;
  317. proxy_set_header Host {{domain}}.test.proginn.com;
  318. }
  319. location ^~ /wo/cash {
  320. proxy_pass http://127.0.0.1:3000;
  321. proxy_set_header Host {{domain}}.test.proginn.com;
  322. }
  323. location ^~ /sign/new {
  324. proxy_pass http://127.0.0.1:3000;
  325. proxy_set_header Host {{domain}}.test.proginn.com;
  326. }
  327. location ^~ /type/interview {
  328. proxy_pass http://127.0.0.1:3000;
  329. proxy_set_header Host {{domain}}.test.proginn.com;
  330. }
  331. location ^~ /type/partners/ {
  332. proxy_pass http://127.0.0.1:3000;
  333. proxy_set_header Host {{domain}}.test.proginn.com;
  334. }
  335. location ^~ /wo/bills {
  336. proxy_pass http://127.0.0.1:3000;
  337. proxy_set_header Host {{domain}}.test.proginn.com;
  338. }
  339. location ^~ /recruit/ {
  340. proxy_pass http://127.0.0.1:3000;
  341. proxy_set_header Host {{domain}}.test.proginn.com;
  342. }
  343. location ^~ /salary/ {
  344. proxy_pass http://127.0.0.1:3000;
  345. proxy_set_header Host {{domain}}.test.proginn.com;
  346. }
  347. location ^~ /salary/detail {
  348. proxy_pass http://127.0.0.1:3000;
  349. proxy_set_header Host {{domain}}.test.proginn.com;
  350. }
  351. location ^~ /credit {
  352. proxy_pass http://127.0.0.1:3000;
  353. proxy_set_header Host {{domain}}.test.proginn.com;
  354. }
  355. location ^~ /work_down {
  356. proxy_pass http://127.0.0.1:3000;
  357. proxy_set_header Host {{domain}}.test.proginn.com;
  358. }
  359. location ^~ /frontend/ {
  360. proxy_pass http://127.0.0.1:3000;
  361. proxy_set_header Host {{domain}}.test.proginn.com;
  362. }
  363. location ^~ /ccf/ {
  364. proxy_pass http://127.0.0.1:3000;
  365. proxy_set_header Host {{domain}}.test.proginn.com;
  366. }
  367. location ^~ /otherpage {
  368. proxy_pass http://127.0.0.1:3000;
  369. proxy_set_header Host {{domain}}.test.proginn.com;
  370. }
  371. location ^~ /upload_image {
  372. proxy_pass http://127.0.0.1;
  373. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  374. }
  375. location ^~ /Public/ {
  376. # 匹配任何以 /Public/ 开头的地址,匹配符合以后,停止往下搜索正则,采用这一条。
  377. expires 1d;
  378. access_log off;
  379. }
  380. access_log /data/log/access.log proginn-logid;
  381. }
  382. # 新后台
  383. server {
  384. listen 80;
  385. server_name {{domain}}.test-rooter.proginn.com;
  386. root /boss/dist;
  387. index index.html index.htm;
  388. location / {
  389. if (!-e $request_filename) {
  390. rewrite ^(.*)$ /index.html last;
  391. break;
  392. }
  393. }
  394. set $temp_request_id $http_x_request_id;
  395. if ($temp_request_id = "") {
  396. set $temp_request_id $request_id;
  397. }
  398. location /api {
  399. proxy_pass http://127.0.0.1;
  400. proxy_set_header Host {{domain}}.test.proginn.com;
  401. }
  402. location ^~ /upload_image {
  403. proxy_pass http://127.0.0.1;
  404. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  405. }
  406. location ^~ /uapi {
  407. proxy_pass http://127.0.0.1:5000;
  408. proxy_set_header Host {{domain}}.test.proginn.com;
  409. }
  410. location ^~ /wapi {
  411. proxy_pass http://127.0.0.1:5000;
  412. proxy_set_header Host {{domain}}.test.proginn.com;
  413. }
  414. location ^~ /sapi {
  415. proxy_pass http://127.0.0.1:5000;
  416. proxy_set_header Host {{domain}}.test.proginn.com;
  417. }
  418. access_log /data/log/boss.log proginn-logid;
  419. }
  420. # festival
  421. server {
  422. listen 80;
  423. server_name {{domain}}.test-festival.proginn.com;
  424. root /boss/dist;
  425. index index.html index.htm;
  426. location / {
  427. if (!-e $request_filename) {
  428. rewrite ^(.*)$ /index.html last;
  429. break;
  430. }
  431. }
  432. location /api {
  433. proxy_pass http://127.0.0.1;
  434. proxy_set_header Host {{domain}}.test.proginn.com;
  435. }
  436. location ^~ /upload_image {
  437. proxy_pass http://127.0.0.1;
  438. proxy_set_header Host {{domain}}.test.proginn.com;
  439. }
  440. access_log /data/log/festival.log proginn-logid;
  441. }
  442. # 用户模块
  443. server {
  444. listen 5000;
  445. server_name {{domain}}.test.proginn.com;
  446. root /proginn-user/public/;
  447. index index.php index.html index.htm;
  448. location / {
  449. if (!-e $request_filename) {
  450. rewrite ^(.*)$ /index.php?s=$1 last;
  451. break;
  452. }
  453. }
  454. set $temp_request_id $http_x_request_id;
  455. if ($temp_request_id = "") {
  456. set $temp_request_id $request_id;
  457. }
  458. location ~ \.php$ {
  459. fastcgi_pass unix:/var/run/php7-fpm.sock;
  460. fastcgi_index index.php;
  461. include fastcgi_params;
  462. }
  463. access_log /data/log/user_proginn_access.log proginn-logid;
  464. }
  465. # bituni
  466. server {
  467. listen 80;
  468. server_name {{domain}}.test-bituni.proginn.com;
  469. root /proginn-bituni/public/;
  470. index index.php index.html index.htm;
  471. location / {
  472. if (!-e $request_filename) {
  473. rewrite ^(.*)$ /index.php?s=$1 last;
  474. break;
  475. }
  476. }
  477. set $temp_request_id $http_x_request_id;
  478. if ($temp_request_id = "") {
  479. set $temp_request_id $request_id;
  480. }
  481. location ~ \.php$ {
  482. fastcgi_pass unix:/var/run/php7-fpm.sock;
  483. fastcgi_index index.php;
  484. include fastcgi_params;
  485. }
  486. location ^~ /qd {
  487. proxy_pass http://127.0.0.1:3001;
  488. proxy_set_header Host {{domain}}.test.proginn.com;
  489. }
  490. access_log /data/log/user_proginn_access.log proginn-logid;
  491. }