proginn.nginx.conf 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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. rewrite ^/learn(.*)$ https://{{domain}}.test.proginn.com/frontend/skill/list permanent;
  164. location / {
  165. if (!-e $request_filename) {
  166. rewrite ^(.*)$ /index.php?s=$1 last;
  167. break;
  168. }
  169. }
  170. set $temp_request_id $http_x_request_id;
  171. if ($temp_request_id = "") {
  172. set $temp_request_id $request_id;
  173. }
  174. location /community {
  175. rewrite ^/community(.*)$ https://{{domain}}.test-jishuin.proginn.com$1 permanent;
  176. }
  177. location /festival {
  178. alias /festival/dist;
  179. index index.html index.htm;
  180. if (!-e $request_filename) {
  181. rewrite ^(.*)$ /festival/index.html last;
  182. break;
  183. }
  184. }
  185. location /oauth2 {
  186. alias /code/web/openx/public/oauth2;
  187. index index.php;
  188. if (!-e $request_filename) {
  189. rewrite ^(.*)$ /oauth2/index.php last;
  190. break;
  191. }
  192. location ~ \.php$ {
  193. fastcgi_pass unix:/var/run/php7-fpm.sock;
  194. fastcgi_index index.php;
  195. include fastcgi_params;
  196. fastcgi_param SCRIPT_FILENAME $request_filename;
  197. }
  198. }
  199. location /openapi {
  200. alias /code/web/openx/public/api;
  201. index index.php;
  202. if (!-e $request_filename) {
  203. rewrite ^(.*)$ /openapi/index.php last;
  204. break;
  205. }
  206. location ~ \.php$ {
  207. fastcgi_pass unix:/var/run/php7-fpm.sock;
  208. fastcgi_index index.php;
  209. include fastcgi_params;
  210. fastcgi_param SCRIPT_FILENAME $request_filename;
  211. }
  212. }
  213. location ~ \.php$ {
  214. fastcgi_pass unix:/var/run/php7-fpm.sock;
  215. fastcgi_index index.php;
  216. include fastcgi_params;
  217. }
  218. location ^~ /type/vip {
  219. proxy_pass http://127.0.0.1:3000;
  220. proxy_set_header Host {{domain}}.test.proginn.com;
  221. }
  222. location ^~ /cert {
  223. proxy_pass http://127.0.0.1:3000;
  224. proxy_set_header Host {{domain}}.test.proginn.com;
  225. }
  226. location ^~ /group {
  227. proxy_pass http://127.0.0.1:3000;
  228. proxy_set_header Host {{domain}}.test.proginn.com;
  229. }
  230. location ^~ /kaifain/add {
  231. proxy_pass http://127.0.0.1:3000;
  232. proxy_set_header Host {{domain}}.test.proginn.com;
  233. }
  234. location ^~ /kaifain/preview {
  235. proxy_pass http://127.0.0.1:3000;
  236. proxy_set_header Host {{domain}}.test.proginn.com;
  237. }
  238. location ^~ /setting/check/old_mobile {
  239. proxy_pass http://127.0.0.1:3000;
  240. proxy_set_header Host {{domain}}.test.proginn.com;
  241. }
  242. location ^~ /setting/check/real_info {
  243. proxy_pass http://127.0.0.1:3000;
  244. proxy_set_header Host {{domain}}.test.proginn.com;
  245. }
  246. location ^~ /setting/check/change_mobile {
  247. proxy_pass http://127.0.0.1:3000;
  248. proxy_set_header Host {{domain}}.test.proginn.com;
  249. }
  250. location ^~ /user/register {
  251. proxy_pass http://127.0.0.1:3000;
  252. proxy_set_header Host {{domain}}.test.proginn.com;
  253. }
  254. location ^~ /.nuxt {
  255. proxy_pass http://127.0.0.1:3000;
  256. proxy_set_header Host {{domain}}.test.proginn.com;
  257. }
  258. location ^~ /_nuxt {
  259. proxy_pass http://127.0.0.1:3000;
  260. proxy_set_header Host {{domain}}.test.proginn.com;
  261. }
  262. location ^~ /wo/cash {
  263. proxy_pass http://127.0.0.1:3000;
  264. proxy_set_header Host {{domain}}.test.proginn.com;
  265. }
  266. location ^~ /sign/new {
  267. proxy_pass http://127.0.0.1:3000;
  268. proxy_set_header Host {{domain}}.test.proginn.com;
  269. }
  270. location ^~ /type/interview {
  271. proxy_pass http://127.0.0.1:3000;
  272. proxy_set_header Host {{domain}}.test.proginn.com;
  273. }
  274. location ^~ /type/partners/ {
  275. proxy_pass http://127.0.0.1:3000;
  276. proxy_set_header Host {{domain}}.test.proginn.com;
  277. }
  278. location ^~ /wo/bills {
  279. proxy_pass http://127.0.0.1:3000;
  280. proxy_set_header Host {{domain}}.test.proginn.com;
  281. }
  282. location ^~ /recruit/ {
  283. proxy_pass http://127.0.0.1:3000;
  284. proxy_set_header Host {{domain}}.test.proginn.com;
  285. }
  286. location ^~ /salary/ {
  287. proxy_pass http://127.0.0.1:3000;
  288. proxy_set_header Host {{domain}}.test.proginn.com;
  289. }
  290. location ^~ /salary/detail {
  291. proxy_pass http://127.0.0.1:3000;
  292. proxy_set_header Host {{domain}}.test.proginn.com;
  293. }
  294. location ^~ /credit {
  295. proxy_pass http://127.0.0.1:3000;
  296. proxy_set_header Host {{domain}}.test.proginn.com;
  297. }
  298. location ^~ /work_down {
  299. proxy_pass http://127.0.0.1:3000;
  300. proxy_set_header Host {{domain}}.test.proginn.com;
  301. }
  302. location ^~ /frontend/ {
  303. proxy_pass http://127.0.0.1:3000;
  304. proxy_set_header Host {{domain}}.test.proginn.com;
  305. }
  306. location ^~ /ccf/ {
  307. proxy_pass http://127.0.0.1:3000;
  308. proxy_set_header Host {{domain}}.test.proginn.com;
  309. }
  310. location ^~ /otherpage {
  311. proxy_pass http://127.0.0.1:3000;
  312. proxy_set_header Host {{domain}}.test.proginn.com;
  313. }
  314. location ^~ /upload_image {
  315. proxy_pass http://127.0.0.1;
  316. proxy_set_header Host {{domain}}.test-jishuin.proginn.com;
  317. }
  318. location ^~ /Public/ {
  319. # 匹配任何以 /Public/ 开头的地址,匹配符合以后,停止往下搜索正则,采用这一条。
  320. expires 1d;
  321. access_log off;
  322. }
  323. access_log /data/log/access.log proginn-logid;
  324. }
  325. # 新后台
  326. server {
  327. listen 80;
  328. server_name {{domain}}.test-rooter.proginn.com;
  329. root /boss/dist;
  330. index index.html index.htm;
  331. location / {
  332. if (!-e $request_filename) {
  333. rewrite ^(.*)$ /index.html last;
  334. break;
  335. }
  336. }
  337. set $temp_request_id $http_x_request_id;
  338. if ($temp_request_id = "") {
  339. set $temp_request_id $request_id;
  340. }
  341. location /api {
  342. proxy_pass http://127.0.0.1;
  343. proxy_set_header Host {{domain}}.test.proginn.com;
  344. }
  345. location ^~ /upload_image {
  346. proxy_pass http://127.0.0.1;
  347. proxy_set_header Host {{domain}}.test.proginn.com;
  348. }
  349. access_log /data/log/boss.log proginn-logid;
  350. }
  351. # festival
  352. server {
  353. listen 80;
  354. server_name {{domain}}.test-festival.proginn.com;
  355. root /boss/dist;
  356. index index.html index.htm;
  357. location / {
  358. if (!-e $request_filename) {
  359. rewrite ^(.*)$ /index.html last;
  360. break;
  361. }
  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/festival.log proginn-logid;
  372. }