proginn.nginx.conf 12 KB

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