nginx.conf 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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. location /api/kernels/ {
  298. proxy_pass http://127.0.0.1:8888;
  299. proxy_set_header Host $host;
  300. # websocket support
  301. proxy_http_version 1.1;
  302. proxy_set_header Upgrade "websocket";
  303. proxy_set_header Connection "Upgrade";
  304. proxy_read_timeout 86400;
  305. }
  306. error_page 404 /404.html;
  307. location = /40x.html {
  308. }
  309. error_page 500 502 503 504 /50x.html;
  310. location = /50x.html {
  311. }
  312. }
  313. server {
  314. listen 443;
  315. server_name www.hichinatravel.com;
  316. gzip on;
  317. gzip_min_length 1k;
  318. gzip_comp_level 9;
  319. 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;
  320. gzip_vary on;
  321. gzip_disable "MSIE [1-6]\.";
  322. if ($http_host != www.hichinatravel.com) {
  323. rewrite (.*) https://www.hichinatravel.com$1 permanent;
  324. }
  325. root /usr/share/nginx/html;
  326. ssl on;
  327. ssl_certificate /etc/nginx/cert/fullchain.pem;
  328. ssl_certificate_key /etc/nginx/cert/private.key;
  329. ssl_session_timeout 5m;
  330. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  331. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  332. ssl_prefer_server_ciphers on;
  333. # Load configuration files for the default server block.
  334. include /etc/nginx/default.d/*.conf;
  335. location / {
  336. proxy_set_header X-Real-IP $remote_addr;
  337. proxy_set_header Host www.hichinatravel.com;
  338. proxy_pass http://127.0.0.1:9057;
  339. #proxy_pass "http://47.100.21.205:9995/";
  340. }
  341. location /service {
  342. rewrite /service(.*) $1 break;
  343. proxy_pass http://127.0.0.1:9056;
  344. proxy_redirect off;
  345. proxy_set_header Host www.hichinatravel.com;
  346. proxy_set_header X-Real-IP $remote_addr;
  347. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  348. }
  349. error_page 404 /404.html;
  350. location = /40x.html {
  351. }
  352. error_page 500 502 503 504 /50x.html;
  353. location = /50x.html {
  354. }
  355. }
  356. server {
  357. listen 443;
  358. server_name qa.hichinatravel.com;
  359. if ($http_host != qa.hichinatravel.com) {
  360. rewrite (.*) https://qa.hichinatravel.com$1 permanent;
  361. }
  362. root /usr/share/nginx/html;
  363. ssl on;
  364. ssl_certificate /etc/nginx/cert/fullchain.pem;
  365. ssl_certificate_key /etc/nginx/cert/private.key;
  366. ssl_session_timeout 5m;
  367. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  368. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  369. ssl_prefer_server_ciphers on;
  370. # Load configuration files for the default server block.
  371. include /etc/nginx/default.d/*.conf;
  372. location / {
  373. proxy_set_header X-Real-IP $remote_addr;
  374. proxy_set_header Host qa.hichinatravel.com;
  375. proxy_pass http://127.0.0.1:9053;
  376. #proxy_pass "http://47.100.21.205:9995/";
  377. }
  378. location /service {
  379. rewrite /service(.*) $1 break;
  380. proxy_pass http://127.0.0.1:9052;
  381. proxy_redirect off;
  382. proxy_set_header Host qa.hichinatravel.com;
  383. proxy_set_header X-Real-IP $remote_addr;
  384. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  385. }
  386. error_page 404 /404.html;
  387. location = /40x.html {
  388. }
  389. error_page 500 502 503 504 /50x.html;
  390. location = /50x.html {
  391. }
  392. }
  393. server {
  394. listen 443;
  395. server_name mayan.hichinatravel.com;
  396. if ($http_host != mayan.hichinatravel.com) {
  397. rewrite (.*) https://mayan.hichinatravel.com$1 permanent;
  398. }
  399. root /usr/share/nginx/html;
  400. ssl on;
  401. ssl_certificate /etc/nginx/cert/fullchain.pem;
  402. ssl_certificate_key /etc/nginx/cert/private.key;
  403. ssl_session_timeout 5m;
  404. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  405. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  406. ssl_prefer_server_ciphers on;
  407. # Load configuration files for the default server block.
  408. include /etc/nginx/default.d/*.conf;
  409. location / {
  410. proxy_set_header X-Real-IP $remote_addr;
  411. proxy_set_header Host mayan.hichinatravel.com;
  412. proxy_pass http://127.0.0.1:85;
  413. }
  414. error_page 404 /404.html;
  415. location = /40x.html {
  416. }
  417. error_page 500 502 503 504 /50x.html;
  418. location = /50x.html {
  419. }
  420. }
  421. server {
  422. listen 443;
  423. server_name photoprism.hichinatravel.com;
  424. if ($http_host != photoprism.hichinatravel.com) {
  425. rewrite (.*) https://photoprism.hichinatravel.com$1 permanent;
  426. }
  427. root /usr/share/nginx/html;
  428. ssl on;
  429. ssl_certificate /etc/nginx/cert/fullchain.pem;
  430. ssl_certificate_key /etc/nginx/cert/private.key;
  431. ssl_session_timeout 5m;
  432. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  433. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  434. ssl_prefer_server_ciphers on;
  435. # Load configuration files for the default server block.
  436. include /etc/nginx/default.d/*.conf;
  437. location / {
  438. proxy_set_header X-Real-IP $remote_addr;
  439. proxy_set_header Host photoprism.hichinatravel.com;
  440. proxy_pass http://127.0.0.1:2342;
  441. }
  442. error_page 404 /404.html;
  443. location = /40x.html {
  444. }
  445. error_page 500 502 503 504 /50x.html;
  446. location = /50x.html {
  447. }
  448. }
  449. server {
  450. listen 443;
  451. server_name git.hichinatravel.com;
  452. if ($http_host != git.hichinatravel.com) {
  453. rewrite (.*) https://git.hichinatravel.com$1 permanent;
  454. }
  455. root /usr/share/nginx/html;
  456. ssl on;
  457. ssl_certificate /etc/nginx/cert/fullchain.pem;
  458. ssl_certificate_key /etc/nginx/cert/private.key;
  459. ssl_session_timeout 5m;
  460. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  461. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  462. ssl_prefer_server_ciphers on;
  463. # Load configuration files for the default server block.
  464. include /etc/nginx/default.d/*.conf;
  465. location / {
  466. proxy_set_header X-Real-IP $remote_addr;
  467. proxy_set_header Host git.hichinatravel.com;
  468. proxy_pass http://127.0.0.1:3001;
  469. }
  470. error_page 404 /404.html;
  471. location = /40x.html {
  472. }
  473. error_page 500 502 503 504 /50x.html;
  474. location = /50x.html {
  475. }
  476. }
  477. server {
  478. listen 443;
  479. server_name wiki.hichinatravel.com;
  480. if ($http_host != wiki.hichinatravel.com) {
  481. rewrite (.*) https://wiki.hichinatravel.com$1 permanent;
  482. }
  483. root /usr/share/nginx/html;
  484. ssl on;
  485. ssl_certificate /etc/nginx/cert/fullchain.pem;
  486. ssl_certificate_key /etc/nginx/cert/private.key;
  487. ssl_session_timeout 5m;
  488. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  489. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  490. ssl_prefer_server_ciphers on;
  491. # Load configuration files for the default server block.
  492. include /etc/nginx/default.d/*.conf;
  493. location / {
  494. proxy_set_header X-Real-IP $remote_addr;
  495. proxy_set_header Host wiki.hichinatravel.com;
  496. proxy_pass http://127.0.0.1:3000;
  497. }
  498. error_page 404 /404.html;
  499. location = /40x.html {
  500. }
  501. error_page 500 502 503 504 /50x.html;
  502. location = /50x.html {
  503. }
  504. }
  505. }