nginx.conf 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. # For more information on configuration, see:
  2. # * Official English Documentation: http://nginx.org/en/docs/
  3. # * Official Russian Documentation: http://nginx.org/ru/docs/
  4. user nginx;
  5. worker_processes auto;
  6. error_log /var/log/nginx/error.log;
  7. pid /run/nginx.pid;
  8. # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
  9. include /usr/share/nginx/modules/*.conf;
  10. events {
  11. worker_connections 1024;
  12. }
  13. http {
  14. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  15. '$status $body_bytes_sent "$http_referer" '
  16. '"$http_user_agent" "$http_x_forwarded_for"';
  17. access_log /var/log/nginx/access.log main;
  18. sendfile on;
  19. tcp_nopush on;
  20. tcp_nodelay on;
  21. keepalive_timeout 65;
  22. types_hash_max_size 2048;
  23. client_max_body_size 50M;
  24. include /etc/nginx/mime.types;
  25. default_type application/octet-stream;
  26. # Load modular configuration files from the /etc/nginx/conf.d directory.
  27. # See http://nginx.org/en/docs/ngx_core_module.html#include
  28. # for more information.
  29. include /etc/nginx/conf.d/*.conf;
  30. # server {
  31. # server_name hichinatravel.com;
  32. # rewrite ^(.*) https://www.hichinatravel.com$1 permanent;
  33. # }
  34. server {
  35. listen 80 default_server;
  36. listen [::]:80 default_server;
  37. server_name _;
  38. root /usr/share/nginx/html;
  39. # Load configuration files for the default server block.
  40. include /etc/nginx/default.d/*.conf;
  41. location / {
  42. }
  43. error_page 404 /404.html;
  44. location = /40x.html {
  45. }
  46. error_page 500 502 503 504 /50x.html;
  47. location = /50x.html {
  48. }
  49. return 301 https://$host$request_uri;
  50. }
  51. server {
  52. listen 443;
  53. server_name www.hichinatravel.com;
  54. if ($http_host != www.hichinatravel.com) {
  55. rewrite (.*) https://www.hichinatravel.com$1 permanent;
  56. }
  57. root /usr/share/nginx/html;
  58. ssl on;
  59. ssl_certificate /etc/nginx/cert/fullchain.pem;
  60. ssl_certificate_key /etc/nginx/cert/private.key;
  61. ssl_session_timeout 5m;
  62. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  63. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  64. ssl_prefer_server_ciphers on;
  65. # Load configuration files for the default server block.
  66. include /etc/nginx/default.d/*.conf;
  67. location / {
  68. proxy_set_header X-Real-IP $remote_addr;
  69. proxy_set_header Host hichinatravel.com;
  70. proxy_pass http://127.0.0.1:8765;
  71. #proxy_pass "http://47.100.21.205:9995/";
  72. }
  73. location /staticresource/ {
  74. rewrite /staticresource(.*) $1 break;
  75. proxy_pass http://127.0.0.1:8011;
  76. proxy_redirect off;
  77. proxy_set_header Host hichinatravel.com;
  78. proxy_set_header X-Real-IP $remote_addr;
  79. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  80. }
  81. error_page 404 /404.html;
  82. location = /40x.html {
  83. }
  84. error_page 500 502 503 504 /50x.html;
  85. location = /50x.html {
  86. }
  87. }
  88. # server {
  89. # listen 80;
  90. # server_name www.hichinatravel.com;
  91. # root /usr/share/nginx/html;
  92. # # Load configuration files for the default server block.
  93. # include /etc/nginx/default.d/*.conf;
  94. # location / {
  95. # proxy_set_header X-Real-IP $remote_addr;
  96. # proxy_set_header Host hichinatravel.com;
  97. # proxy_pass http://127.0.0.1:8765;
  98. # }
  99. # location /staticresource/ {
  100. # rewrite /staticresource(.*) $1 break;
  101. # proxy_pass http://127.0.0.1:8011;
  102. # proxy_redirect off;
  103. # proxy_set_header Host hichinatravel.com;
  104. # proxy_set_header X-Real-IP $remote_addr;
  105. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  106. # }
  107. # error_page 404 /404.html;
  108. # location = /40x.html {
  109. # }
  110. # error_page 500 502 503 504 /50x.html;
  111. # location = /50x.html {
  112. # }
  113. # }
  114. server {
  115. listen 443;
  116. server_name owncloud.hichinatravel.com;
  117. if ($http_host != owncloud.hichinatravel.com) {
  118. rewrite (.*) https://owncloud.hichinatravel.com$1 permanent;
  119. }
  120. root /usr/share/nginx/html;
  121. ssl on;
  122. ssl_certificate /etc/nginx/cert/fullchain.pem;
  123. ssl_certificate_key /etc/nginx/cert/private.key;
  124. ssl_session_timeout 5m;
  125. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  126. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  127. ssl_prefer_server_ciphers on;
  128. # Load configuration files for the default server block.
  129. include /etc/nginx/default.d/*.conf;
  130. location / {
  131. proxy_set_header X-Real-IP $remote_addr;
  132. proxy_set_header Host owncloud.hichinatravel.com;
  133. proxy_cookie_domain owncloud.hichinatravel.com $host;
  134. sub_filter "owncloud.hichinatravel.com" $host;
  135. proxy_pass http://127.0.0.1:8085;
  136. }
  137. error_page 404 /404.html;
  138. location = /40x.html {
  139. }
  140. error_page 500 502 503 504 /50x.html;
  141. location = /50x.html {
  142. }
  143. }
  144. # server {
  145. # listen 80;
  146. # server_name owncloud.hichinatravel.com;
  147. # root /usr/share/nginx/html;
  148. # # Load configuration files for the default server block.
  149. # include /etc/nginx/default.d/*.conf;
  150. # location / {
  151. # proxy_set_header X-Real-IP $remote_addr;
  152. # proxy_set_header Host owncloud.hichinatravel.com;
  153. # proxy_cookie_domain owncloud.hichinatravel.com $host;
  154. # sub_filter "owncloud.hichinatravel.com" $host;
  155. # proxy_pass http://127.0.0.1:8085;
  156. # }
  157. # error_page 404 /404.html;
  158. # location = /40x.html {
  159. # }
  160. # error_page 500 502 503 504 /50x.html;
  161. # location = /50x.html {
  162. # }
  163. # }
  164. server {
  165. listen 80;
  166. server_name elastic.hichinatravel.com;
  167. root /usr/share/nginx/html;
  168. # Load configuration files for the default server block.
  169. include /etc/nginx/default.d/*.conf;
  170. location / {
  171. proxy_set_header X-Real-IP $remote_addr;
  172. proxy_set_header Host elastic.hichinatravel.com;
  173. proxy_cookie_domain elastic.hichinatravel.com $host;
  174. sub_filter "elastic.hichinatravel.com" $host;
  175. proxy_pass http://127.0.0.1:9200;
  176. }
  177. error_page 404 /404.html;
  178. location = /40x.html {
  179. }
  180. error_page 500 502 503 504 /50x.html;
  181. location = /50x.html {
  182. }
  183. }
  184. server {
  185. listen 80;
  186. server_name kibana.hichinatravel.com;
  187. root /usr/share/nginx/html;
  188. # Load configuration files for the default server block.
  189. include /etc/nginx/default.d/*.conf;
  190. location / {
  191. proxy_set_header X-Real-IP $remote_addr;
  192. proxy_set_header Host kibana.hichinatravel.com;
  193. proxy_cookie_domain kibana.hichinatravel.com $host;
  194. sub_filter "kibana.hichinatravel.com" $host;
  195. proxy_pass http://127.0.0.1:5601;
  196. }
  197. error_page 404 /404.html;
  198. location = /40x.html {
  199. }
  200. error_page 500 502 503 504 /50x.html;
  201. location = /50x.html {
  202. }
  203. }
  204. server {
  205. listen 443;
  206. server_name admin.hichinatravel.com;
  207. if ($http_host != admin.hichinatravel.com) {
  208. rewrite (.*) https://admin.hichinatravel.com$1 permanent;
  209. }
  210. root /usr/share/nginx/html;
  211. ssl on;
  212. ssl_certificate /etc/nginx/cert/fullchain.pem;
  213. ssl_certificate_key /etc/nginx/cert/private.key;
  214. ssl_session_timeout 5m;
  215. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  216. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  217. ssl_prefer_server_ciphers on;
  218. # Load configuration files for the default server block.
  219. include /etc/nginx/default.d/*.conf;
  220. location / {
  221. proxy_set_header X-Real-IP $remote_addr;
  222. proxy_set_header Host admin.hichinatravel.com;
  223. proxy_pass http://127.0.0.1:9055;
  224. }
  225. location /service {
  226. rewrite /service(.*) $1 break;
  227. proxy_pass http://127.0.0.1:9054;
  228. proxy_redirect off;
  229. proxy_set_header Host admin.hichinatravel.com;
  230. proxy_set_header X-Real-IP $remote_addr;
  231. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  232. }
  233. error_page 404 /404.html;
  234. location = /40x.html {
  235. }
  236. error_page 500 502 503 504 /50x.html;
  237. location = /50x.html {
  238. }
  239. }
  240. server {
  241. listen 443;
  242. server_name admin-qa.hichinatravel.com;
  243. if ($http_host != admin-qa.hichinatravel.com) {
  244. rewrite (.*) https://admin-qa.hichinatravel.com$1 permanent;
  245. }
  246. root /usr/share/nginx/html;
  247. ssl on;
  248. ssl_certificate /etc/nginx/cert/fullchain.pem;
  249. ssl_certificate_key /etc/nginx/cert/private.key;
  250. ssl_session_timeout 5m;
  251. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  252. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  253. ssl_prefer_server_ciphers on;
  254. # Load configuration files for the default server block.
  255. include /etc/nginx/default.d/*.conf;
  256. location / {
  257. proxy_set_header X-Real-IP $remote_addr;
  258. proxy_set_header Host admin-qa.hichinatravel.com;
  259. proxy_pass http://127.0.0.1:9051;
  260. }
  261. location /service {
  262. rewrite /service(.*) $1 break;
  263. proxy_pass http://127.0.0.1:9050;
  264. proxy_redirect off;
  265. proxy_set_header Host admin-qa.hichinatravel.com;
  266. proxy_set_header X-Real-IP $remote_addr;
  267. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  268. }
  269. error_page 404 /404.html;
  270. location = /40x.html {
  271. }
  272. error_page 500 502 503 504 /50x.html;
  273. location = /50x.html {
  274. }
  275. }
  276. server {
  277. listen 443;
  278. server_name jupyter.hichinatravel.com;
  279. if ($http_host != jupyter.hichinatravel.com) {
  280. rewrite (.*) https://jupyter.hichinatravel.com$1 permanent;
  281. }
  282. root /usr/share/nginx/html;
  283. ssl on;
  284. ssl_certificate /etc/nginx/cert/fullchain.pem;
  285. ssl_certificate_key /etc/nginx/cert/private.key;
  286. ssl_session_timeout 5m;
  287. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  288. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  289. ssl_prefer_server_ciphers on;
  290. # Load configuration files for the default server block.
  291. include /etc/nginx/default.d/*.conf;
  292. location / {
  293. proxy_set_header X-Real-IP $remote_addr;
  294. proxy_set_header Host jupyter.hichinatravel.com;
  295. proxy_pass http://127.0.0.1:8888;
  296. }
  297. error_page 404 /404.html;
  298. location = /40x.html {
  299. }
  300. error_page 500 502 503 504 /50x.html;
  301. location = /50x.html {
  302. }
  303. }
  304. server {
  305. listen 443;
  306. server_name preprod.hichinatravel.com;
  307. gzip on;
  308. gzip_min_length 1k;
  309. gzip_comp_level 9;
  310. gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  311. gzip_vary on;
  312. gzip_disable "MSIE [1-6]\.";
  313. if ($http_host != preprod.hichinatravel.com) {
  314. rewrite (.*) https://preprod.hichinatravel.com$1 permanent;
  315. }
  316. root /usr/share/nginx/html;
  317. ssl on;
  318. ssl_certificate /etc/nginx/cert/fullchain.pem;
  319. ssl_certificate_key /etc/nginx/cert/private.key;
  320. ssl_session_timeout 5m;
  321. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  322. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  323. ssl_prefer_server_ciphers on;
  324. # Load configuration files for the default server block.
  325. include /etc/nginx/default.d/*.conf;
  326. location / {
  327. proxy_set_header X-Real-IP $remote_addr;
  328. proxy_set_header Host preprod.hichinatravel.com;
  329. proxy_pass http://127.0.0.1:9057;
  330. #proxy_pass "http://47.100.21.205:9995/";
  331. }
  332. location /service {
  333. rewrite /service(.*) $1 break;
  334. proxy_pass http://127.0.0.1:9056;
  335. proxy_redirect off;
  336. proxy_set_header Host preprod.hichinatravel.com;
  337. proxy_set_header X-Real-IP $remote_addr;
  338. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  339. }
  340. error_page 404 /404.html;
  341. location = /40x.html {
  342. }
  343. error_page 500 502 503 504 /50x.html;
  344. location = /50x.html {
  345. }
  346. }
  347. server {
  348. listen 443;
  349. server_name qa.hichinatravel.com;
  350. if ($http_host != qa.hichinatravel.com) {
  351. rewrite (.*) https://qa.hichinatravel.com$1 permanent;
  352. }
  353. root /usr/share/nginx/html;
  354. ssl on;
  355. ssl_certificate /etc/nginx/cert/fullchain.pem;
  356. ssl_certificate_key /etc/nginx/cert/private.key;
  357. ssl_session_timeout 5m;
  358. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  359. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  360. ssl_prefer_server_ciphers on;
  361. # Load configuration files for the default server block.
  362. include /etc/nginx/default.d/*.conf;
  363. location / {
  364. proxy_set_header X-Real-IP $remote_addr;
  365. proxy_set_header Host qa.hichinatravel.com;
  366. proxy_pass http://127.0.0.1:9053;
  367. #proxy_pass "http://47.100.21.205:9995/";
  368. }
  369. location /service {
  370. rewrite /service(.*) $1 break;
  371. proxy_pass http://127.0.0.1:9052;
  372. proxy_redirect off;
  373. proxy_set_header Host qa.hichinatravel.com;
  374. proxy_set_header X-Real-IP $remote_addr;
  375. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  376. }
  377. error_page 404 /404.html;
  378. location = /40x.html {
  379. }
  380. error_page 500 502 503 504 /50x.html;
  381. location = /50x.html {
  382. }
  383. }
  384. server {
  385. listen 443;
  386. server_name mayan.hichinatravel.com;
  387. if ($http_host != mayan.hichinatravel.com) {
  388. rewrite (.*) https://mayan.hichinatravel.com$1 permanent;
  389. }
  390. root /usr/share/nginx/html;
  391. ssl on;
  392. ssl_certificate /etc/nginx/cert/fullchain.pem;
  393. ssl_certificate_key /etc/nginx/cert/private.key;
  394. ssl_session_timeout 5m;
  395. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  396. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  397. ssl_prefer_server_ciphers on;
  398. # Load configuration files for the default server block.
  399. include /etc/nginx/default.d/*.conf;
  400. location / {
  401. proxy_set_header X-Real-IP $remote_addr;
  402. proxy_set_header Host mayan.hichinatravel.com;
  403. proxy_pass http://127.0.0.1:85;
  404. }
  405. error_page 404 /404.html;
  406. location = /40x.html {
  407. }
  408. error_page 500 502 503 504 /50x.html;
  409. location = /50x.html {
  410. }
  411. }
  412. server {
  413. listen 443;
  414. server_name photoprism.hichinatravel.com;
  415. if ($http_host != photoprism.hichinatravel.com) {
  416. rewrite (.*) https://photoprism.hichinatravel.com$1 permanent;
  417. }
  418. root /usr/share/nginx/html;
  419. ssl on;
  420. ssl_certificate /etc/nginx/cert/fullchain.pem;
  421. ssl_certificate_key /etc/nginx/cert/private.key;
  422. ssl_session_timeout 5m;
  423. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  424. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  425. ssl_prefer_server_ciphers on;
  426. # Load configuration files for the default server block.
  427. include /etc/nginx/default.d/*.conf;
  428. location / {
  429. proxy_set_header X-Real-IP $remote_addr;
  430. proxy_set_header Host photoprism.hichinatravel.com;
  431. proxy_pass http://127.0.0.1:2342;
  432. }
  433. error_page 404 /404.html;
  434. location = /40x.html {
  435. }
  436. error_page 500 502 503 504 /50x.html;
  437. location = /50x.html {
  438. }
  439. }
  440. server {
  441. listen 443;
  442. server_name git.hichinatravel.com;
  443. if ($http_host != git.hichinatravel.com) {
  444. rewrite (.*) https://git.hichinatravel.com$1 permanent;
  445. }
  446. root /usr/share/nginx/html;
  447. ssl on;
  448. ssl_certificate /etc/nginx/cert/fullchain.pem;
  449. ssl_certificate_key /etc/nginx/cert/private.key;
  450. ssl_session_timeout 5m;
  451. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  452. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  453. ssl_prefer_server_ciphers on;
  454. # Load configuration files for the default server block.
  455. include /etc/nginx/default.d/*.conf;
  456. location / {
  457. proxy_set_header X-Real-IP $remote_addr;
  458. proxy_set_header Host git.hichinatravel.com;
  459. proxy_pass http://127.0.0.1:3001;
  460. }
  461. error_page 404 /404.html;
  462. location = /40x.html {
  463. }
  464. error_page 500 502 503 504 /50x.html;
  465. location = /50x.html {
  466. }
  467. }
  468. server {
  469. listen 443;
  470. server_name wiki.hichinatravel.com;
  471. if ($http_host != wiki.hichinatravel.com) {
  472. rewrite (.*) https://wiki.hichinatravel.com$1 permanent;
  473. }
  474. root /usr/share/nginx/html;
  475. ssl on;
  476. ssl_certificate /etc/nginx/cert/fullchain.pem;
  477. ssl_certificate_key /etc/nginx/cert/private.key;
  478. ssl_session_timeout 5m;
  479. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  480. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  481. ssl_prefer_server_ciphers on;
  482. # Load configuration files for the default server block.
  483. include /etc/nginx/default.d/*.conf;
  484. location / {
  485. proxy_set_header X-Real-IP $remote_addr;
  486. proxy_set_header Host wiki.hichinatravel.com;
  487. proxy_pass http://127.0.0.1:3000;
  488. }
  489. error_page 404 /404.html;
  490. location = /40x.html {
  491. }
  492. error_page 500 502 503 504 /50x.html;
  493. location = /50x.html {
  494. }
  495. }
  496. }